Question

Locked

Multitask Batch File

By joshmorgan ·
I would like to create a batch file that runs three other programs one after the other. I have a .exe file that installs certain data to a pc. After that I run a batch file that does a task, and then run another batch file to due another task. Is there a way to write a batch file that will run the exe, when that is done run the first batch file and then the second?

This conversation is currently closed to new comments.

3 total posts (Page 1 of 1)  
| Thread display: Collapse - | Expand +

All Answers

Collapse -

START command

by formerly CallPete.com In reply to Multitask Batch File

If you run a command in a batch file, it will run and come back when its finished.
If you want to start a command, then immediately start another one, use START.

Example:
prog1
prog2
prog3

will run prog1, wait for it to finish, then execute prog2... and so on.

Example2:
start prog1
start prog2
start prog3

This will start all three right away.

Hope this helps.

Collapse -

When you run a batch file from within another batch file

by neilb@uk In reply to Multitask Batch File

you have to use 'call' else the command processing will stop at the end of the second batch file.

The file, say batch1.bat containing:

batch2.bat
batch3.bat

will exit on completion of batch2.bat. Batch3 won't be run.

The following batch1.bat:

call batch2.bat
batch3.bat

will run batch2 to completion and then return to batch1 and run batch3.bat, stopping the command processing at the end of batch3.

For exes, you don't need call.

Neil :)

Back to Software Forum
3 total posts (Page 1 of 1)  

Related Discussions

Related Forums