Sometimes, we all just need to take a break. Even Batch Files! There never really was a proper built in Pause command for Batch Files. The existing “Pause” command really just halts the script and waits for you to “Press Any Key To Continue”. If you’re looking to put a timed pause in a batch script, you can custom tailor the PING command to do just that.
In this example here, I’m going to make the batch file pause for 10 seconds.
PING 127.0.0.1 -n 11 > nul
Essentially the value after the “-n” switch specifies the number of seconds + 1. This handly little command can come in very useful in many scenarios such as waiting for services or applications to start, login scripts to complete running, etc.
Written By: Amardeep Juneja