home *** CD-ROM | disk | FTP | other *** search
- ------------------------------------------------------------------------------
- Program Name...:Datecheck.COM
- Author.........:Rusty Brown Irving, Texas
- Where Found....:PC WORLD (May 1988 Issue)
- ------------------------------------------------------------------------------
-
- Description:
-
- DATECHECK.COM is simple command file that calls DOS function 2A which
- returns the weekday as a number from 0 to 6 ie(Sunday is 0, Monday is 1,
- etc...). DATECHECK is used by calling the command from a batch file, and
- then using the "IF ERRORLEVEL" batch file command to test the value.
-
- EXAMPLE:
-
- echo off
- datechek
- if errorlevel 6 goto SAT
- if errorlevel 5 goto FRI
- if errorlevel 4 goto THU
- if errorlevel 3 goto WED
- if errorlevel 2 goto TUE
- if errorlevel 1 goto MON
- if errorlevel 0 goto SUN
- :SUN
- echo Today is Sunday
- REM Insert Sunday commands
- goto exit
- :MON
- echo Today is Monday
- REM Insert Mondays commands
- goto exit
- :TUE
- echo Today is Tuesday
- REM Insert Tuesday commands
- goto exit
- :WED
- echo Today is Wednesday
- REM Insert Wednesday commands
- goto exit
- :THU
- echo Today is Thursday
- REM Insert Thursday commands
- goto exit
- :FRI
- echo Today is Friday
- REM Insert Friday commands
- goto exit
- :SAT
- echo Today is Saturday
- REM Insert Saturday commands
- goto exit
- :exit
-
- NOTE: You may also take advantage of the IF NOT ERRORLEVEL batch file command
- to verify what day it is NOT.
- See Your DOS manual for further explainations in the use of IF ERRORLEVEL and
- GOTO batch file commands.
-