In some cases you need to wait for a certain time after calling an application from your batch file. For example, it's useful when this application must finish its work. How can one include delay in his batch script? There are several different solutions.
- The first way is the simplest one. You can just include "pause" command in your script. This way has a really big drawback: this command requires a key pressing to continue the execution. So this command cannot be used in pure automated scripts, because you must ask someone to press a key.
- The second way is to use ping command. Of course, this command is not designed for adding delays to the batch files, but it's really handy to use it in this case. The following code will make delay for ten seconds: ping -n 11 -w 1000 127.0.0.1 > nul
- You can use 'Sleep' utility from Windows Resource Kit. Its usage will look like sleep 10.
No comments:
Post a Comment