How to start two parallel progs and wait for exit of both?

Discussion forum for all Windows batch related topics.

Moderator: DosItHelp

Post Reply
Message
Author
pstein
Posts: 125
Joined: 09 Nov 2011 01:42

How to start two parallel progs and wait for exit of both?

#1 Post by pstein » 25 Nov 2011 12:10

In a DOS batch file I want to start two instances (which interact) of one long-running prgm myprog.exe
but with different cmdline parameters.

The progr. (resp the instances) in general opens a cmdline windows and outputs somthing.

The batch script should wait until both instanes have finished their work and then resume with the following commands in batch script.

How can I do this?

Is it possible that the first prgm redirects its output to the cmdline window of the script?
The second instance should open a a separate cmdprompt window.

Alltogether in pseudecode the script should look like:

....
start /LOW /B /INTHISWINDOW myprog.exe "parm1"
start /LOW /B /INNEWWINDOW myprog.exe "parm2"
wait until firstinstance(myprog.exe) has exit AND secondinstance(myprog.exe) has exit
Echo both instance have finished
....

Post Reply