Reputation: 11
Experts, I am trying to run a bat file using the below.
start /wait "D:|Silent_installer.bat"
start /wait 'D:def.bat"
It's happening like both bat files running at the same time.
But I wanted the first bat file to run completely then def.bat should start. The first bat file takes approx 60 min and inbetween second bat file starting.Ideally I wanted the first batch to complete 100% then second bat file should start.
I also used call like below but no luck
call "abc.bat"
call "def.bat"
Any suggestions would be of great help
Upvotes: 1
Views: 14144
Reputation: 67196
Ok. Two points here.
The start
command is used for asynchronous execution, so if you " wanted the first batch to complete 100% then second bat file should start", just don't use it!
In order to execute two Batch files from inside another one, you must use call
command as you show us in your question, that is:
.
call "abc.bat"
call "def.bat"
Perhaps if you explain what "I also used call like below but no luck" means, we may help you in a better way.
PS - Did you realized that your first example
"D:|Silent_installer.bat"
contain an invalid character |
in the name of the Batch file?
Upvotes: 1
Reputation: 41224
You have to use start "" /wait command
with the program in the abc.bat file itself. One of the programs being used inside abc.bat is multi-threaded and lets the batch file end before it finishes.
Upvotes: 3