DOS command for ‘Wait 5 seconds…’

DOS command for ‘Wait 5 seconds…’

I came up with a somewhat odd way of waiting for a specified amount of time the other day when writing a batch file.

First, it requires the PING tool, so I don’t know if it will work very well for you, but it’s worth a shot.

Use it like this if you want to wait 5 seconds with no output:

PING 1.1.1.1 /N 3 /W 1000 > NUL

The general rule that seems to be pretty accurate is to divide the number of seconds to wait by 2 and use that value for the /N switch. This example is for 5 seconds, so you use use /N 3 to get pretty close to 5 secs (about 5.3 secs on my system).

發表迴響

你的電子郵件位址並不會被公開。 必要欄位標記為 *

What is 7 + 12 ?
Please leave these two fields as-is:
IMPORTANT! To be able to proceed, you need to solve the following simple math (so we know that you are a human) :-)