I want to run some command once, 10 seconds to 1 minute from now.
at command only receives absolute times, like 11:50.
How can it be done? Can it be done with other command line means?
Super User is a question and answer site for computer enthusiasts and power users. It only takes a minute to sign up.Sign up to join this community
timeout command can handle that:
timeout /t 10 >NUL echo "this message will be echoed after 10 seconds timeout"
timeout /t 10 >NUL && echo "this message will be echoed after 10 seconds timeout"
For more information, see
timeout /?. The use of
>NUL is to avoid it showing timeout on the screen, feel free to remove it.
timeout not available on your system, you could also use
ping -n 10 127.0.0.1 >NUL instead of
timeout /t 10 >NUL as described here.
On Xp I used a seperate sleep executable came in some microsoft package , worked in seconds.
In windows 7 , I switched and started using
timeout /T 1 > NUL With the 1 representing the ammount of seconds.
Timeout /? for the help on it.
Without the redirection of the output
timeout 10 it shows an abortable countdown, which has other uses.
It was always important to me to find the one that required minimal resources, both of these methods seem to require very little effort for the computer.