Sunday, December 4, 2011

How to make a batch file wait for a specified amount of time?

I want a batch file that will loop like this:





:1


(wait command?)


ipconfig /renew


goto :1|||Put the following in place, It creates a Visual Basic script that will wait for the time specified, currently 30 seconds, then it deletes the VB script.





@ECHO OFF





:1





echo %26gt;wait.vbs wscript.sleep 30000


cscript wait.vbs


del wait.vbs





ipconfig /renew


goto :1|||Call an external utility that waits for the amount of time you tell it to. There's no "wait" command in batch.

No comments:

Post a Comment