Pause for X seconds in batch file?

Everyone who ever tried to automate routine tasks in windows knows that there is no sleep() program or its analogue. At least in default windows installation.

But there is quite an unexpected workaround:

ping -n 2 127.0.0.1 > nul

will stop batch execution for 2 seconds. (Replace 2 with your number for longer pause.)

Very simple and neat. Or is it?

Leave a comment

1 Comments.

  1. Dude, that is so simple, very neat, and exactly what i’m looking for. good on ya, cheers!!

Leave a Reply

Yandex Mail.ru Google LiveJournal myOpenId Flickr claimId Blogger Wordpress OpenID Yahoo Technorati Vidoop Verisign AOL


[ Ctrl + Enter ]

7 visitors online now
7 guests, 0 members
Max visitors today: 8 at 01:19 am MST
This month: 30 at 09-01-2010 12:31 am MST
This year: 41 at 01-23-2010 03:43 am MST
All time: 41 at 01-23-2010 03:43 am MST