user2427534
user2427534

Reputation: 11

running multiple exe through batch file

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

Answers (4)

Aacini
Aacini

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

foxidrive
foxidrive

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

Ation
Ation

Reputation: 731

You could use Start command to start application

Upvotes: 1

bcolin
bcolin

Reputation: 438

why not simply

"abc.bat"
"def.bat"

in your batch file ?

Upvotes: 2

Related Questions