You are viewing the article How to Defer Batch File at Lassho.edu.vn you can quickly access the necessary information in the table of contents of the article below.
This article is co-authored by a team of editors and trained researchers who confirm the accuracy and completeness of the article.
The wikiHow Content Management team carefully monitors the work of editors to ensure that every article is up to a high standard of quality.
This article has been viewed 5,299 times.
This wikiHow teaches you how to prevent a batch file from automatically executing as soon as it is opened. There are several different commands you can use to delay the batch file depending on your needs. Note that you should have a solid grasp of how to write batch files before attempting to delay this type of script file.
. Click the Windows icon in the lower left corner of the screen.
- If you have a batch file that needs to be delayed, just right-click the file and select Edit to open the file in Notepad. In this case, you can skip the next two steps.
@echo off
command, and then import the contents of the batch file as you want.- PAUSE — Causes the batch file to pause until you press some standard key (such as space).
- TIMEOUT — The batch file will wait for the specified number of seconds (or keystrokes) before continuing.
- PING — Pauses the batch file until it receives a ping command from the specified computer address. This usually causes a short delay when you ping the execution address.
- PAUSE — Type pause into the command line. You don’t need any additional content.
- TIMEOUT — Type timeout time , replacing “time” with the number of seconds you want to delay. For example, if you want to delay the batch file for 30 seconds, enter timeout 30 .
- If you want to prevent others from skipping a pause with a certain keypress, enter timeout time /nobreak (where “time” is the number of seconds to delay).
- PING — Type ping address , where “address” is the IP address of the computer or website you want to PING.
- Click File , select Save As….
- Enter a filename, followed by the .bat extension (for example, “My Batch File” would be “My Batch File.bat”).
- Click the “Save as type” drop-down box and then select All Files .
- Choose a save location and then click Save .
Advice
- You can execute the batch file on any Windows computer by double clicking on the file.
- The “PAUSE” command is most appropriate when you are relying on a certain user to trigger the continuation of a batch file, while the “TIMEOUT” command is appropriate if you want to allow the file to execute automatically.
Warning
- The former “SLEEP” command no longer works on Windows 10.
- Batch files will not run on Mac computers.
This article is co-authored by a team of editors and trained researchers who confirm the accuracy and completeness of the article.
The wikiHow Content Management team carefully monitors the work of editors to ensure that every article is up to a high standard of quality.
This article has been viewed 5,299 times.
This wikiHow teaches you how to prevent a batch file from automatically executing as soon as it is opened. There are several different commands you can use to delay the batch file depending on your needs. Note that you should have a solid grasp of how to write batch files before attempting to delay this type of script file.
Thank you for reading this post How to Defer Batch File at Lassho.edu.vn You can comment, see more related articles below and hope to help you with interesting information.
Related Search: