Printer Version Table of Contents Project Home Page
.EXAMPLE.....: 62 Run specific software, depending on the day of the week
.CATEGORY....: examples
This is a very common use for Fdate. I use it to load an alarm-clock TSR (Terminate and Stay Resident, "memory resident", program) that beeps at me (at different times on different days of the week) to remind me that it is time to attend a meeting that is regularly scheduled for that day of the week.

Note that stuff for a given day of the week will be executed every time you boot up on that day of the week. If you want stuff (e.g. a backup job) to be run only once (the first time you boot up) on a given day of the week, then:

Remember that if you are executing other batch files from a batch file, you should invoke them with a CALL statement:

              CALL batchfilename parm1 parm2 ...
so control will return to the calling batch file when execution of the called batch file is complete.

Note that the string comparison is case sensitive.

:: get 3-character day-of-week name and put it in DOW e-var

if (%DOW%)==(Mon) alarmTSR.exe 10:30 Time for Monday staff meeting

if (%DOW%)==(Fri) echo Running Friday backup.  Please wait...
if (%DOW%)==(Fri) CALL BACKUP C:
if (%DOW%)==(Fri) CALL BACKUP D:
set dow=