Windows batch: sleep [duplicate]

Solution 1:

You can try

ping -n XXX 127.0.0.1 >nul

where XXX is the number of seconds to wait, plus one.

Solution 2:

I don't know why those commands are not working for you, but you can also try timeout

timeout <delay in seconds>

Solution 3:

timeout /t 10 /nobreak > NUL

/t specifies the time to wait in seconds

/nobreak won't interrupt the timeout if you press a key (except CTRL-C)

> NUL will suppress the output of the command

Solution 4:

To wait 10 seconds:

choice /T 10 /C X /D X /N