J Jay Somerset Feb 2, 2004 #1 Is there any way to pause for a specified number of seconds in a CMD script? Like the UNIX "sleep" command?
Is there any way to pause for a specified number of seconds in a CMD script? Like the UNIX "sleep" command?
R Ray at Feb 3, 2004 #2 SET NumberOfSeconds=4 SET /A NumberOfSeconds+=1 >nul ping -n %NumberOfSeconds% localhost>nul echo I waited %NumberOfSeconds% seconds. pause That's the trick I've seen used often, anyway!
SET NumberOfSeconds=4 SET /A NumberOfSeconds+=1 >nul ping -n %NumberOfSeconds% localhost>nul echo I waited %NumberOfSeconds% seconds. pause That's the trick I've seen used often, anyway!
R Ray at Feb 3, 2004 #3 Oops. This would display the wrong number of seconds since I added 1 to the input value. My bad. ;]
P Phil Robyn Feb 3, 2004 #4 Ray at said: Oops. This would display the wrong number of seconds since I added 1 to the input value. My bad. ;] Click to expand... No, Ray, what you did (add one second) was in fact correct. To pause for 10 seconds, use 'ping -n 11 localhost > nul'.
Ray at said: Oops. This would display the wrong number of seconds since I added 1 to the input value. My bad. ;] Click to expand... No, Ray, what you did (add one second) was in fact correct. To pause for 10 seconds, use 'ping -n 11 localhost > nul'.
R Ray at Feb 3, 2004 #5 Thanks Phil, but I was talking about my last line where I had: echo I waited %NumberOfSeconds% seconds. :] -- Ray at work Microsoft ASP MVP Phil Robyn said: Ray at said: Oops. This would display the wrong number of seconds since I added 1 to the input value. My bad. ;] Click to expand... No, Ray, what you did (add one second) was in fact correct. To pause for 10 seconds, use 'ping -n 11 localhost > nul'. -- Phil Robyn Univ. of California, Berkeley u n z i p m y a d d r e s s t o s e n d e - m a i l Click to expand...
Thanks Phil, but I was talking about my last line where I had: echo I waited %NumberOfSeconds% seconds. :] -- Ray at work Microsoft ASP MVP Phil Robyn said: Ray at said: Oops. This would display the wrong number of seconds since I added 1 to the input value. My bad. ;] Click to expand... No, Ray, what you did (add one second) was in fact correct. To pause for 10 seconds, use 'ping -n 11 localhost > nul'. -- Phil Robyn Univ. of California, Berkeley u n z i p m y a d d r e s s t o s e n d e - m a i l Click to expand...
J Jay Somerset Feb 3, 2004 #6 PERFECT! That was just the sort of "trick" I was looking for. I can now create a SLEEP command based on PING. Many Thanks, Jay
PERFECT! That was just the sort of "trick" I was looking for. I can now create a SLEEP command based on PING. Many Thanks, Jay
J Jay Somerset Feb 3, 2004 #7 Here is the completed SLEEP command, saved in WINNT... @set /A snooze=1+%1 @ping -n %snooze% localhost > nul Thanks agin, Ray.
Here is the completed SLEEP command, saved in WINNT... @set /A snooze=1+%1 @ping -n %snooze% localhost > nul Thanks agin, Ray.
R Ray at Feb 3, 2004 #8 You're welcome and thanks to whoever first thought of doing this. :] Ray at work