9

I have some EXE programs,Want to run using batch file one after another.

Actually one set contains 2 EXE programs with some parameters.

Example.

@echo off  
start prog1.exe
start prog2.exe

/---wait untill prog1.exe and prog2.exe finish--/

start prog3.exe
start prog4.exe
Hansa
  • 149
  • 1
  • 1
  • 8
  • You don't know how much time to wait. Could you just run prog1.exe and prog2.exe sync one after another and than prog3.exe and proc4.exe simultanously? – LukeCodeBaker Aug 21 '13 at 09:59
  • possible duplicate of [Parallel execution of shell processes](http://stackoverflow.com/questions/672719/parallel-execution-of-shell-processes) – mmmmmm Aug 21 '13 at 10:22
  • This is called a "rendezvous". You have to wait for _two_ processes. – MSalters Aug 21 '13 at 10:55

2 Answers2

8

To run the .exes sequentually you need to pass the /wait parameter to start

e.g.

@echo off  
start /wait prog1.exe
start /wait prog2.exe
start /wait prog3.exe
start /wait prog4.exe

However that does not run start1 and 2 in parallel. For more complex use see answers to this question

Community
  • 1
  • 1
mmmmmm
  • 32,227
  • 27
  • 88
  • 117
0

you don't even need the "start /wait". it will automatically call the program and wait if you just put "progx.exe"