# DOS Wait for another batch to complete



## richardlee77 (Jul 20, 2011)

I'm trying to wait for another batch job to complete before executing. Here is what i'm trying to do.

start c:\temp\batchjob1.bat
start c:\temp\batchjob2.bat

then i want to wait till these two batch job complete and executed the next set of batch job.

start c:\temp\batchjob3.bat
start c:\temp\batchjob4.bat

and then do another wait and execute another set of batch jobs.

I would like to have the set of batch job run in parallel. I know there's a wait command in DOS.

start /wait c:\temp\batchjob3.bat

now how can i execute batchjob4.bat in parallel with batchjob3.bat at the same time.

Rich


----------



## Squashman (Apr 4, 2003)

Maybe I am misunderstanding you but this is what I would do.

```
start "" "c:\temp\batchjob1.bat"
start "" /wait "c:\temp\batchjob2.bat"
```
So at this point job 1 and job 2 are running simultaneously but it will not move onto job 3 because the calling batch file has to wait for job 2 to finish before it executes job 3 & 4.
So the next two lines of code would just be.

```
start ""  "c:\temp\batchjob3.bat"
start "" /wait "c:\temp\batchjob4.bat"
```
So now job 3 & 4 are running but the calling batch file will wait until job 4 is complete before it moves on.


----------

