I'm running a bat file located on a remote server.
The command is: wmic /node:[server name] process call create "cmd.exe /c [bat file location].
I would like the command to wait until the batch file execution completing. In other words: the command is part of Jenkins (Hudson) job, and the next step after the window batch command starting before the batch file tasks completed. I would like the next step to be executed just after the batch file execution completing. * The batch file task (content) is restoring of a DB.
Windows – wait until completing WMIC process call create cmd.exe to run bat
batch-filewindowswmic
Related Topic
- Windows – Task Scheduler not able to execute .vbs scripts successfully
- Windows – import configuration file when batch start ? (OS=Windows)
- Windows – How to run batch file without a window in ONE file
- Powershell – Batch script is not getting executed when called by Start-Process Cmdlet
- Windows Server 2012 R2 Task Scheduler access denied (0x80070005), but command works manually in shell
- Windows – WMIC Returns Localdatetime with Deviating Timezone
Best Answer
Next commented code snippet could do the job. Unfortunately, I can test it only on local node.
Resources (required reading, incomplete):
%~G
etc. special page) Command Line arguments (Parameters)>NUL
,|
etc. special page) Redirection%_toRun:\=\\%
etc.) Variable Edit/Replace%%
,""
,^
etc. special page) Escape Characters, Delimiters and Quotes