Add Comment
|
Related Links
|
TrackBack
Sleep.bat (GPL)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. UsageSleep.bat second(s) ExamplesSleep.bat 60 Chieh Cheng 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. Chieh Cheng I found a bug in the latest release of Sleep.bat, so I fixed it in the newer version attached below. Chieh Cheng 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 ... Chieh Cheng Improved the script by checking whether the time is more than 0. Otherwise, the script just returns immediately. Chieh Cheng
Add Comment
|
Related Links
|
TrackBack
Did your message disappear? Read the Forums FAQ. TrackBackTrackBack only accepted from WebSite-X Suite web sites. Do not submit TrackBacks from other sites. Send Ping | TrackBack URL | Spam Control Title: NUL Missing on WinFLP Add CommentSpam Control | * indicates required field Messages, files, and images copyright by respective owners. |
Products
|
Services
56 Users Online
|
Copyright © 1996 - 2024. All Rights Reserved. |