In windows batch file, if myScript.bat runs otherScript.bat, and in otherScript.bat, there's a pause in first line. How can I send a keystroke to skip that pause in myScript.bat? So my script won't need to take any extract keystroke and won't be blocked by the pause. Thanks.
Type in your command. TIMEOUT — Type timeout time where "time" is replaced by the number of seconds to delay. For example, typing in timeout 30 will delay your batch file for 30 seconds.
pause. When placed in a batch file, pause stops the file from running until you press a key to continue.
One way would be to use the echo
command to do the keystroke for you.
For example:
@echo OFF @echo Calling otherScript.bat... @echo | call otherScript.bat @echo Done.
pause @echo Hello World
Stefan's solution is more flexible and allows you to control when to pause or not, but this solution will work if you're not able to revise otherScript.bat for some reason.
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