Batch file to pause for x seconds




















Stack Overflow for Teams — Collaborate and share knowledge with a private group. Create a free Team What is Teams? Learn more. Better way to wait a few seconds in a bat file? Asked 12 years, 6 months ago. Active 9 years, 3 months ago.

Viewed k times. Improve this question. Community Bot 1. Srekel Srekel 2 2 gold badges 3 3 silver badges 7 7 bronze badges. Silly that the command would even be accepted But apparently, the Windows ping command treats anything shorter than four digits as an acceptable IP octet Add a comment.

Active Oldest Votes. Here I go again Improve this answer. It should be noted that while the choice command is waiting 5 seconds for input, the timer gets reset each and every time the user presses a key. So it is possible that your batch file will never exit this choice step. Therefore it is also impossible to guarantee that the routine will only wait 5 seconds -- it could be longer because of a key press.

At first I thought you were wrong. Use WScript. The following batch code uses a temporary VBScript file to generate an accurate delay:. Or if you want to allow the user to skip the delay:. ECHO Wait for a specified number of seconds. ECHO Where: seconds is the number of seconds to wait ECHO The delay time will not be very accurate.

ECHO Backup has been skipped. Not Helpful 0 Helpful 1. You might have pressed a key before or during the timeout part. Not Helpful 0 Helpful 0. Include your email address to get a message when this question is answered. You can run your batch file on any Windows computer by double-clicking it. Helpful 0 Not Helpful 0. The "PAUSE" command is best used in situations where you're relying on a user to trigger the next section of the batch file, while the "TIMEOUT" command is suited to situations in which you want to allow the file to run automatically.

Helpful 0 Not Helpful 1. Helpful 0 Not Helpful 2. You Might Also Like How to. How to. About This Article. Written by:. Co-authors: Updated: December 25, Categories: Programming. Article Summary X 1. Italiano: Ritardare l'Esecuzione di un File Batch. Bahasa Indonesia: Menunda Berkas Batch. Nederlands: Een batchbestand pauzeren.

Thanks to all authors for creating a page that has been read 1,, times. The ping one, especially. I was working on crashing computers and I worked out that it takes windows to crash an 8GB RAM, but with this command it takes 64 only. More reader stories Hide reader stories. Is this article up to date? This browser is no longer supported. Download Microsoft Edge More info. Contents Exit focus mode. Is this page helpful?



0コメント

  • 1000 / 1000