call setbootinfo.cmdsomewhere in your startup command sequence, where it would get executed once per bootup. It will modify the file c:\bootinfo\bootinfo.txt (and also uses a couple other files in that directory) to contain information about the timestamp of the current boot cycle, and also the number of boot cycles experienced during the same day. So if the bootcount (first value) is 1, you know this is the first boot cycle of the day. Typically, you wouldn't care about values other than 1 or not 1, but the count is kept just in case.
parameter | effect |
---|---|
Set environment variables bootcount and bootdow (day of week). | |
date | Set environment variables bootcount, bootdow, bootdate, and boottime. |
detail | Set environment variables bootcount, bootdow, bootdate, boottime, bootyear, bootmonth, bootday, boothour bootminute, bootsecond, and bootfrac. |
noshow | Suppress display of enviroment variables |
rem replace <path to profile> with your path to your profile, of course
@call getbootinfo noshow
@if %bootday%. = Mon. if %bootcount%. == 1. @(
@rem # delete download history from profile
@del <path to profile>\downloads.rdf
)
rem replace <path to place backups> with where the file copies should be saved
@call getbootinfo detail noshow
@if %bootcount%. == . @(
@rem save one copy for each day of the week
@copy critical.file <path to place backups>\critical_%bootday%.file
)