|
| ||||||||||
| Tags: batch file, sleep command, sleep mode, windows |
![]() |
| | Thread Tools | Search this Thread |
|
#1
| ||||
| ||||
| How Sleep command work on Batch file in Windows
|
|
#2
| |||
| |||
| Re: How Sleep command work on Batch file in Windows
Most operating systems provide a command in batch files to sleep, or wait, a certain number of seconds. This is great in that batch files can display text, allowing you time to read before continuing. If you have Python installed, or don't mind installing it (it has other uses too) , just create the following sleep.py script and add it somewhere in your PATH: import time, sys time.sleep(float(sys.argv[1])) In XP, you can edit it in: My Computer → Properties (menu) → Advanced (tab) → Environment Variables (button) → System variables (frame) |
|
#3
| ||||
| ||||
| Re: How Sleep command work on Batch file in Windows
Sleep.bat is a Windows batch program that pauses your batch file for temporary before continuing. Sleep.exe is included in most DOS resource kits. If that is the case, that's the best idea. If you don't have it, it's easily found on the Internet (I added it to my Windows XP). I assume of course that you can add executable to your box. The easiest solution in Windows XP / 2003 environment is to install Windows Server 2003 Resource Kit Tools. This tool kit will install the Sleep.exe program into your machine, which you can use as SLEEP n to sleep for N sec. If you want to sleep for just a few milliseconds u can use this command as SLEEP –M n |
|
#4
| |||
| |||
| Re: How Sleep command work on Batch file in Windows
The Resource Kit has always included this. At least since Windows 2000. Sleep.bat uses the "ping.exe" program to emulate the sleep function. The "ping.exe" program is distributed with most versions of Windows operating system. Sleep.bat takes advantage of the SetNumberOfArguments.bat (GPL) script that is available on this web site. So to use Sleep.bat, you'll have to download SetNumberOfArguments.bat, if you don't already have it. |
![]() |
|
| Thread Tools | Search this Thread |
| |
Similar Threads for: "How Sleep command work on Batch file in Windows" | ||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| FTP Upload batch file doesn't work properly in Task Scheduler | supphavith09 | Windows Server Help | 1 | 09-02-2012 06:39 AM |
| How to work with if command and batch file | kolton | Operating Systems | 5 | 30-11-2010 11:09 PM |
| stringtokenizer in batch file / dos command | sayeed | Software Development | 2 | 14-10-2009 01:26 PM |
| Can We check the exit command in the batch file | Dhruv | Software Development | 3 | 30-12-2008 10:56 PM |
| Fast User Switching via Command Line or Batch File? | Woody45 | Vista Help | 1 | 18-03-2007 12:22 AM |