Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Run multiple bat files which has "pause" in it

I have the following 2 bat files:

1.bat
------
//a line which does something
pause

2.bat
------
//a line which does the other something
pause

Now, how do I run these bat files within a new bat file, by ignoring the pause(s)?

like image 937
Sandeep Avatar asked Sep 28 '12 09:09

Sandeep


People also ask

What does @echo off do in Bat?

To prevent echoing a particular command in a batch file, insert an @ sign in front of the command. To prevent echoing all commands in a batch file, include the echo off command at the beginning of the file.

How do I pause a batch file while running?

You can insert the pause command before a section of the batch file that you might not want to process. When pause suspends processing of the batch program, you can press CTRL+C and then press Y to stop the batch program.

How do I run a batch file repeatedly?

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. The above code is for Windows 2000, XP, and later users if you're running earlier Windows 98 or earlier you'd need to use the choice command.


1 Answers

Simple: Remove the PAUSE!

But I assume, one of your restrictions of the problem could be, that you can't remove the pause.

Then you could use redirection to the called batch file.

Something like

call 1.bat < nul
call 2.bat < nul
like image 150
jeb Avatar answered Sep 22 '22 10:09

jeb