Cynosure.X International LLC

:

Add Comment | Related Links | TrackBack
Related Content

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.

Usage

Sleep.bat second(s)

Examples

Sleep.bat 60
Sleep.bat 1

Attached File: Sleep.bat (385 B)

Chieh Cheng
Mon, 09 Jun 2008 21:45:21 +0000

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.

Attached File: 1 - Sleep.bat (670 B)

Chieh Cheng
Wed, 16 Jul 2008 23:26:02 +0000

I found a bug in the latest release of Sleep.bat, so I fixed it in the newer version attached below.

Attached File: 2 - Sleep.bat (701 B)

Chieh Cheng
Tue, 21 Oct 2008 22:55:24 +0000

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 ...

Attached File: 3 - Sleep.bat (1 KB)

Chieh Cheng
Thu, 06 Nov 2008 23:55:48 +0000

Improved the script by checking whether the time is more than 0. Otherwise, the script just returns immediately.

Attached File: 4 - Sleep.bat (2 KB)

Chieh Cheng
Fri, 23 Aug 2024 23:20:04 -0700

Add Comment | Related Links | TrackBack
Related Content

Did your message disappear? Read the Forums FAQ.

TrackBack

TrackBack 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
Weblog: Cynosure.X International
Excerpt: NUL Missing on WinFLP Recently, I have been playing with Windows Fundamentals for Legacy PCs (WinFLP). And I have found that even though WinFLP thinks NUL exists, it actually doesn't exist(unlike Windows XP). So it's been breaking my batch scripts. The following is the error message from using the . . .
Tracked: Wed, 16 Jul 2008 23:27:49 +0000

Add Comment

Spam Control | * indicates required field
Your Name: *
E-mail:
Remember Me!
Comment: *
File attachment is optional. Please do not attach a file to your submission unless it is relevent.
Attach File:
(20 MB Max)
Spam Protection: * Answer of 1 + 4?
Click button only once, please!

Messages, files, and images copyright by respective owners.

Products | Services
Forums | Latest | RSS
Library | Search | Wiki
Help | Licenses

Login | Register

99 Users Online

Hacking Digital Cameras
Fun for Photographers



Amazon Associate

Copyright © 1996 - 2024. All Rights Reserved.