user1863359
user1863359

Reputation: 317

running a batch file when the first one complete

i have 3 batch files

-First.bat (to execute an .exe program that take a while to generate a report) :

start /WAIT /W /B "" "C:\program.exe"

-Second.bat (to rename the generated file and move it to an other location )

-Third.bat (to call the First.bat Then the Second.bat) here is how i write it :

echo batch controller
call "C:\First.bat"
echo booo
call "C:\Second.bat"
echo batch controller running again

the problem is that the second.bat is executed before the first.bat terminate although i write

start /WAIT

Upvotes: 1

Views: 5471

Answers (1)

devnull
devnull

Reputation: 123678

You can say:

echo batch controller & call "C:\First.bat" & echo booo & call "C:\Second.bat" & echo batch controller running again

Command after & will be executed only after the one before it has finished.

Upvotes: 1

Related Questions