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. The above commands will break the timeout process on pressing any key. 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.
So using commands that wont work in every version of windows would not be advisable. 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.
How to wait in a batch script? Asked 12 years, 9 months ago. Active 1 year, 2 months ago. Viewed k times. Improve this question. Thomaschaaf Thomaschaaf Related post - Windows batch: sleep — RBT. Add a comment. Active Oldest Votes. You can ping an address that doesn't exist and specify the desired timeout: ping The -w part specifies the desired timeout in milliseconds.
The -n 1 part tells ping that it should only try once normally it'd try 4 times. BAT - sleeps by the supplied number of seconds ping Quoting from the spec: Improve this answer. I added the actual function its called timeout.. General failure. I was happily using ping 0. Show 4 more comments.
Windows ping pauses for one second between pings so you if you want to sleep for 10 seconds, use ping -n 11 Gleb Gleb 2, 1 1 gold badge 12 12 silver badges 7 7 bronze badges. I like this solution more than the the one marked as the answer because this is cleaner as we don't have to make sure that our script has a non-existent IP address. Historically, Windows system administration has been geared through a graphical interface. This information is provided as is, for anyone having fun hacking old systems, with no guarantee.
Windows XP is an outdated system. Support by Microsoft ended on April 8, Use the information below at your own risk. For day-to-day use, upgrade to Windows 10 which also support Bash and Linux on Windows. There is two possible workarounds. First, is to use a batch script using the PING command. The second solution is to use the Windows Server Ressource Kit tools. With PING you can produce a fixed delay by testing the network loopback address.
The command prompt text can be made up of any normal characters which seems to mean any alphanumeric ASCII characters and support the following list of special codes.
0コメント