Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Waiting until a process created by calling a batch file has completed

MyFile1.bat invokes MyFile2.bat twice:

start MyFile2.bat argA, argB, argC
start MyFile2.bat argX, argY, argZ

At this point, how can I wait until both processes spawned by the calls to MyFile2.bat have completed?

like image 337
barak manos Avatar asked Dec 02 '13 15:12

barak manos


2 Answers

Simple use the Start /WAIT parameter.

start /wait MyFile2.bat argA, argB, argC
start /wait MyFile2.bat argX, argY, argZ
like image 122
Knuckle-Dragger Avatar answered Oct 09 '22 20:10

Knuckle-Dragger


start /w cmd /c "start cmd /c MyFile2.bat argA, argB, argC & start cmd /c MyFile2.bat argA, argB, argCt"

According to my tests this should work providing that the MyFile2.bat .Eventually the full paths to the bat files should be used.

like image 44
npocmaka Avatar answered Oct 09 '22 20:10

npocmaka