Run Several Commands at Once in Batch Scripts


By: Majid Pasha
April 16, 2011

Hi Everyone

Today I want to learn you "How-To" run several commands at once in batch scripting. Here is the code:

Start "" "command1" "arg1" "arg2"
Start "" "command2" "arg1" "arg2"
Start "" "command3" "arg1" "arg2"

Note: "arg" means extra parameters.
Note: Always when there is a space between two words or commands, put each word or command in two ("), For example --> C:\App.exe -silent --> "C:\App.exe" "-silent"
Note: The two quotes ("") after (Start) word is necessary, do not delete them


- Example For running several commands at once in batch scripts:

Start "" "C:\App\majid.exe" "/save" "document.txt"
Start "" "mkdir" "D:\Info"
Start "" "C:\yourapp.exe"

and so on...

Note: All of the commands which have (Start "") at the first and are in a row will run at once, if you write a command which has not (Start "") at first, then batch script will stop at the command and will continue after that.

- For example look at this batch script:

C:\yourapp.exe
Start "" "C:\App\majid.exe" "/save" "document.txt"
Start "" "mkdir" "D:\Info"
C:\info.txt
Start "" "C:\yourapp.exe"

First yourapp.exe will execute, then bat file will stop till it get closed, after that the next two commands will start at once because they have (Start "") at the first. Then the bat file will not wait for them and will run info.txt, after closing it, the next command will run.

Hope you understand :)
Thanks you very much for reading this "How-To"

Special Regards
Majid Pasha


Need more help?
Describe your Problem
Example: Hard Drive Not Detected on My PC

Ask Question