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)?
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.
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.
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.
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
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With