PDQ Library:  Timed Pause in Batch Programs

You must already know how to use batch commands to use this page. I accept
no responsibility for any accidents you have using batch commands.

Temporary Pause in a Batch Program

The following batch program creates a timed pause using a simple program called doze.exe. I have used it with Windows XP, Vista, 7 and 8, but cannot find the source to give credit! My notes say it's written with Microsoft Visual C/C++ v6. This tiny program simply sleeps for a specified time before terminating. If you don't specify the number of seconds in the command, it pauses for 10 seconds. I use instead of using a PAUSE command to pause a batch program to read screen messages then continue.

Download doze.exe (28,672 bytes) by right-clicking the link + saving it to your hard drive. Note the path for use in your batch programs.

Play a Sound in a Batch Program

To play a sound in a script, use wizmo.exe, a useful little utility from GRC.COM (Downloads Page). It also allows you to create icons on your desktop or start menu to shutdown, hibernate, restart or sleep your computer, blank the screen, mute the speaker, run the screensaver, open your CD tray, and other fun stuff. If you put it in the Windows system directory, Windows can find it without specifying a path.

Example using DOZE and WIZMO

The program is executed using the syntax:

DOZE {number of seconds to pause}
Doze displays the following screen message when it starts:
Dozing for 8 seconds .....
Click to select text in box   Select text and type CTRL+C keys to copy it.
@echo off
echo Test playing a sound file wizmo.exe play=C:\Windows\Media\chimes.wav
echo Test pausing 8 seconds before exiting D:\Tools\doze.exe 8
TOP back