Sleep/Pause on the command line

by Brett on December 14, 2006

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 -n 2 -w 1000 > nul
@ping -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).

Previous post:

Next post: