home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
DP Tool Club 17
/
CD_ASCQ_17_101194.iso
/
vrac
/
tsbat46.zip
/
DAILY.BAT
< prev
next >
Wrap
DOS Batch File
|
1992-09-16
|
1KB
|
53 lines
echo off
echo.
echo ┌───────────────────────────────────────────────────┐
echo │ Run a program only once a day at boot time │
echo │ By Prof. Timo Salmi, ts@uwasa.fi, Wed 16-Sep-1992 │
echo └───────────────────────────────────────────────────┘
if "%1"=="" goto _help
rem What date was this bacth last run
if exist date1$$$ goto _date_now
echo Not yet run today > date1$$$
:_date_now
rem What is the current date
echo.|date > date2$$$
rem Compare the last and the current date
fc date2$$$ date1$$$ > tmp$$$
type tmp$$$ | find "no differences encountered" > same$$$
del tmp$$$
if exist doit$$$ del doit$$$
copy same$$$ dont$$$ > nul
del same$$$
rem Move the current date information to the last run date variable
copy date2$$$ date1$$$ > nul
del date2$$$
rem Don't run if the dates match
if exist dont$$$ goto _done
rem Make the call
call %1 %2 %3 %4 %5 %6 %7 %8 %9
goto _out
:_help
echo.
echo If you want to run a program only once a day when you reboot
echo your computer, put
echo.
echo CALL DAILY YourApplicationName [Param1] [Param2] [...]
echo.
echo in your autoexec.bat file.
echo.
goto _out
:_done
del dont$$$
echo %0 has already been run today
:_out