Contents of the ALARM.DOC file
DEMONSTRATION BATCH FILE: ALARM
ALARM.BAT is like a simple alarm clock for your PC. ALARM.BAT waits
until a specified time, then triggers an alarm: it beeps and displays a
message. It continues until someone presses CONTROL-BREAK.
If you enter just "ALARM" at the DOS prompt, without any parameters,
ALARM displays a HELP screen that shows how to use it.
ALARM uses ANSI control codes to control screen color and cursor
placement, so it requires ANSI.SYS in order to work properly.
If you are not using ANSI.SYS, it will display some garbage
characters on your screen unless you modify the batch file to remove
the ANSI control codes.
USAGE : ALARM shows current time in hhmm format
USAGE : ALARM hhmm [msg] waits until hhmm, then sounds an alarm
EXAMPLE : ALARM 0930 [sounds alarm at 9:30 am]
EXAMPLE : ALARM 930 Staff meeting [sounds alarm at 9:30 am]
EXAMPLE : ALARM 1800 [sounds alarm at 6:00 pm]
For midnight, specify 0000 or 2400 for hhmm.
EXAMPLE : ALARM 2400 START MIDNIGHT BATCH RUN
The first thing that ALARM.BAT does is to change to the M: drive. M:
is presumed to be a RAM disk. Before you can use ALARM.BAT, you
should use your favorite text editor to change the RAM disk designation
to point to your own RAM disk. It is possible to run ALARM.BAT from a
normal hard disk or floppy, but because ALARM.BAT does a LOT of disk
activity, it is strongly recommended that you make your current
directory a RAM disk before running it.
To prevent repeated disk accesses to find the FDATE program, you
should also have FDATE on the RAM disk, or be using a cache.
USING ALARM TO CREATE RUN-IT
You can copy ALARM.BAT to another batch file (say, RUN-IT.BAT) and
modify it so that rather than sounding an alarm it triggers other
activiites instead: runs a program or programs, or chains to another
batch file, for example.
To create a generalized RUN-IT.BAT, you could use the words of the
message to pass in the name of a batch file that you want to be run at
a certain time, along with its parameters. Make the triggered activity
rem Note that earlier SHIFT has moved batch file name to parm 1.
rem run %1 batch file.
%1 %2 %3 %4 %5 %6 %7 %8 %9
Then entering this at the DOS prompt:
RUN-IT 0001 BACKUP.BAT C: D: E:
would cause RUN-IT to wait until 1 minute past midnight, then
run a batch file called BACKUP.BAT to backup drives C:, D:, and E:.