Sleep/Pause on the command line
A quick simple way to make the command line stop executing for a certain amount of time is by put
Everyone once in a while I need a way to stop the command line from executing for a certain number of seconds. By putting the 2 below lines in to a sleep.bat file I am able to create this functionality.
@ping 127.0.0.1 -n 2 -w 1000 > nul
@ping 127.0.0.1 -n %1% -w 1000> nul
In order to use this I just type "sleep 10" which will mimic a pause for 10 seconds (really it runs a ping in the background for 10 seconds).

April 22nd, 2009 at 11:04 am
The -w parameter specifies maximum time to wait for each reply. And you are pinging your loopback (127.0.0.1) which responds always and immediately. It is wrong. It is just a luck that one ping takes around 1 second on your PC. You can ping an address that doesn't respond to pings to take advantage of delay timing with -w.