I have a batch file that needs to pause for 10 seconds part way through, then continue. PAUSE command prompts for keystroke. I would like a pause like batch command to wait for 10 seconds before continuing with the rest of the commands.
Do you need a batch file that waits a certain amount of seconds? In some languages, the command would be WAIT, but DOS and Windows do not come with this command for batch files. If you want to implement the WAIT command, create the following batch file and name it WAIT.BAT.
In your batch file, the wait (e.g. 10 seconds) is implemented with a CALL to WAIT.BAT:
CALL WAIT 10
If you are running Windows NT, Windows 2000, or Windows XP, you can use the following as WAIT.BAT:
The reason for the two lines is that in order to wait using the PING command, you must add extra pings to correctly wait the desired number of seconds. Also, since the PING command is being used, it is possible that this WAIT batch file may run over a few milliseconds. Thus, it is not recommended to use this for critical real-time processing.
This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
By continuing to use this site, you are consenting to our use of cookies.