Using a batch file to run 2 commands in order

Hello,
I want to create a batch file that runs 2 executable files but one command has to complete before running the other. All I have is the locations of the two executable files. What other commands to I need to ensure the batch file runs the first command and completes it, then runs the second command
DonKwizoteAsked:
Who is Participating?
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

dipopoCommented:
Use the batch call function

Call abc.bat

call xyz.bat

xyz will NOT execute before abc
0
dipopoCommented:
Have a llok here for explanation.

http://www.computerhope.com/call.htm#03
0
Bill PrewCommented:
You want to use the START command for this, as in:

    START /WAIT program1.exe
    START /WAIT program2.exe

If there are spaces in the EXE path and you need to quote it, then you also need an extra parm (can be empty) as shown here:

    START "" /WAIT "c:\program files\foo\program1.exe"
    START "" /WAIT "c:\program files\foo\program2.exe"

~bp
0

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
10 Tips to Protect Your Business from Ransomware

Did you know that ransomware is the most widespread, destructive malware in the world today? It accounts for 39% of all security breaches, with ransomware gangsters projected to make $11.5B in profits from online extortion by 2019.

Bill PrewCommented:
The CALL statement is only used to call another BAT file from an initial BAT file, not EXE files.  For that we need the START command.

~bp
0
DonKwizoteAuthor Commented:
Thank you. It worked perfectly
0
Bill PrewCommented:
Welcome.

~bp
0
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
Windows 7

From novice to tech pro — start learning today.