Page 1 of 1

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

Posted: 25 Nov 2011 12:10
by pstein
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
....