SHORTIES\RUNCHECK.DOC  ·  DOC  ·  1.2 KB  ·  1990-03-13  ·  from PCPlus_Issue-44_May-1990_FluxEngine-360Kb
What is it ?.
RunCheck is a program which can tell if it has been executed previously today.
Its very handy when used in your Autoexec.bat to avoid repeating 'once a day'
tasks when re-booting. For example loading printer fonts, disk checking and
sorting, virus scanning and so on.

How it works.
When first executed RunCheck creates a 1 byte file lastboot.dat on the root
directory. This file contains the day of the month in hex. Future evocations
cause the program to check today's date with the date stored in lastboot.dat.
If equal the program returns 2, if not lastboot.dat is updated and the program
returns 1. An exit code of 3 indicates a file error which may have been caused
when creating,reading or writing lastboot.dat.

How to use it.
First create \lastboot.dat by running RunCheck. Now place RunCheck immediately
after the date/time is set (ignore for AT upwards) in your AUTOEXEC.BAT file
and then take the following actions based on the returned error-level.

Rem Is this the first boot of the day ?
RUNCHECK
If errorlevel 3 goto file_error
If errorlevel 2 goto quick_boot  .....no
If errorlevel 1 goto full_boot	 .....yes

Hugh G. O'Keeffe 23 January 1990.