You can use timeout command to wait for command prompt or batch script for the specified amount of time. The time is defined in Seconds.
Advertisement
For example to wait for 5 seconds use. Use /T options:
c:/> timeout /T 5
You can also specify seconds directly like:
c:/> timeout 5
The above commands will break the timeout process on pressing any key. You can use /NOBREAK ignore key presses and wait for the specified time.
c:/> timeout /T 5 /NOBREAK
Windows XP users use sleep command instead of the timeout.
c:/> sleep 5
7 Comments
I created a script to change IPs in the stack to commonly used for a project and needed a vanilla set of commands used in CMD to make the change then pause and display that the IPs had changed to the 5 needed for the project. Of Course I made a script to put the table back into DHCP mode. So using commands that wont work in every version of windows would not be advisable.
I had been looking for a PAUSE before running the IPCONFIG and this works great.
I also created a program that pings devices for up and down and a common device that might be on a network and since some of the replacement gear was misconfigured I also scan and alert on that issue too.
`sleep’ is so much simpler and easier to use and is “native” to cmd
:\> sleep 3
Will sleep script/command line for 3 seconds.
what is command for windows 10?
timeout will work in window 10 as well
I am using PowerShell on my system, so I just execute this command:
Hope this help every one.
You can use timeout as well as this will not be visible
timeout 5 >nul