# Dos Wait Command



## daveslack80 (Sep 6, 2011)

Hi,

I am not sure this is possible or not. Below is my bat file. I would like to have bat1, bat2, bat3 to execute at the same time but would like to have bat4, bat5 and bat6 to execute after all 3 three bat script bat1, bat2, and bat3 is complete. what i run into sometime bat3 completes first and it would execute bat4, bat5, and bat6 even though bat1 and bat2 has not completed. is there a way in dos to make all three batch job complete before kicking of the next batch script?

start bat1.bat
start bat2.bat
start /w bat3.bat

start bat4.bat
start bat5.bat
start /w bat6.bat


----------



## leroys1000 (Aug 16, 2007)

Estimate the time it takes for all 3 to complete.
Then you can run a ping command to local host
for the amount of seconds to delay the next command.
Looks like this....
PING 127.0.0.1 -n 6
n is the number of seconds.
Put the command after start bat 3 should delay it for the designated number of seconds.


----------



## Squashman (Apr 4, 2003)

This is what I would do.
At the end of BAT 1,2 & 3 write a completion code to a log file. Then interrogate the log file for all 3 completion codes. You could just echo a Y to the log file after each bat file is done. After the 3 batch files are done the wait log file should be 9 bytes in size.


----------

