1
votes

I have 3 batch files, one.bat, two.bat and three.bat. All three bat files have to start in their own command prompt shells. So now I'm planning a collect.bat which executes all three batch files in one batch file. But I cant figure out how we can make each of the batch files(one.bat, two.bat and three.bat) run in a different window using collect.bat. Any Ideas? Thanks in advance...

3

3 Answers

6
votes

use START for that. Each batch will be STARTed separately without waiting for it to finish

start one.bat
start two.bat
start three.bat
5
votes

you better use

start cmd /c one.bat
start cmd /c two.bat
start cmd /c three.bat

unless you want those windows to remain after bats are finished

3
votes

To add to this... If you need to execute them one at a time, instead of all three at once you need to add /wait.. and if you want to run them minimized add /min as follows:

start /wait /min cmd /c one.bat
start /wait /min cmd /c two.bat
start /wait /min cmd /c three.bat
exit