The simplest way is to abuse the ping command. Since ping sends 1 packet every second, you could have it pause for 5 seconds using the command:
ping -n 5 127.0.0.1 >NUL
If the computer's networking is off, then 127.0.0.1 will fail and timeout, which is an indeterminate length of time. You could try and overcome this by specifying the timeout to be 1000 milliseconds (1 second), like this:
ping -n 5 -w 1000 127.0.0.1 >NUL
Just remember that specifying the timeout only affects the upper limit of time that ping will wait for a packet. You cannot use this to make ping sleep for less than a second.
Of course, there's also a sleep command in one of the Windows Resource Kits, or you could write your own.
Last updated on 2009-05-05 04:28:08 -0700, by Shalom CraimerBack to Tech Journal