Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Execute batch file after another batch file completes [duplicate]

Tags:

batch-file

cmd

Possible Duplicate:
How to call one batch file after another

I have a batch file coordinating the activity of two other batch file. How can I make it execute the second batch file only after the first bat file finishes execution (execute the sequentially). I do not care if the first batch file executes successfully or not.

like image 643
kjv Avatar asked Jun 11 '10 14:06

kjv


People also ask

Can a batch file run another batch file?

Simply entering a batch file's name within another batch file will run the batch file you want to call. However, after the called batch file completes, it won't pass control back to the calling batch file.

How do you sequentially execute commands in batch file?

Try using the conditional execution & or the && between each command either with a copy and paste into the cmd.exe window or in a batch file. Additionally, you can use the double pipe || symbols instead to only run the next command if the previous command failed.

How do you loop or start a batch file over after it has completed?

Pressing "y" would use the goto command and go back to start and rerun the batch file. Pressing any other key would exit the batch file.

What is %% f in batch file?

For simple batch files, a single character such as %%f will work. You can use multiple values for variable in complex batch files to distinguish different replaceable variables.


1 Answers

Use call to continue the execution of the first file, like:

echo batch controller
call batch1.bat
call batch2.bat
echo batch controller running again
like image 80
tanascius Avatar answered Oct 02 '22 22:10

tanascius