Sleep.bat is a Windows batch program that pauses your batch file for temporary before continuing. To use it, call it from you batch file and specify the number of seconds to "sleep". You'll want to use the "call" keyword in order to return to the point of execution.
This version of 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.
Sleep.bat is distributed as executable source code under the GNU General Public License. Please see the license agreement elsewhere on this site.
After trying to use this Sleep.bat file, I found that it crashes on Windows Fundamentals for Legacy PCs (WinFLP). WinFLP doesn't have the NUL device that this script tried to call. So, I've modified it to check for the NUL device and do something slightly different on a Windows distribution that doesn't have the NUL device.
However, to make this script more versatile, I had to pull in three other helper batch files. So, in addition to the SetNumberOfArguments.bat (GPL) script, you'll also need the GetTempPathName.bat (GPL) script, the HasNUL.bat (GPL) script, and the SetVariableToOutput.bat (GPL) script. All of these scripts are also available on this web site. Attached below is the latest version of Sleep.bat.
I found a bug in the latest release of Sleep.bat, so I fixed it in the newer version attached below.
After getting over the missing NUL hurdle, I now found another problem with Sleep.bat on WinFLP; there isn't the ping command on WinFLP. To deal with this issue, Sleep.bat now uses ping.exe if it is found on the operating system, but resorts to Visual Basic Script if it is unable to find the ping.exe. This version works on WinFLP and most other versions of Windows. The new version is attached below.
By the way, in the processing of fixing Sleep.bat, I found Sleep.exe under "C:\Windows\system32" on WinFLP. However, it doesn't do anything when I call it with or without parameter. Interesting ...
Did your message disappear? Read the Forums FAQ.
TrackBack only accepted from WebSite-X Suite web sites. Do not submit TrackBacks from other sites.
Title: NUL Missing on WinFLP
Spam Control | * indicates required field
Messages, files, and images copyright by respective owners.
36 Users Online
Copyright © 1996 - 2021. All Rights Reserved.