most easily it's done by filecheck.
example to %windir%\tempwrite on every logon in the end of script:
code:
run "%comspec% /c echo @date > %windir%\temp\@userid"
run "%comspec% /c echo @time >> %windir%\temp\@userid"
and check it before:
code:
if exist("%windir%\temp\@userid")
$ = open(1,"%windir%\temp\@userid")
$day = readline(1)
$time = substr(readline(1),1,5)
$ = close(1)
if $day = @date ;if same day
if (val(substr($time,1,2)) = val(substr(@time,1,2)) and val(substr($time,4,2))+6 > val(substr(@time,4,2))) or (val(substr($time,1,2))+1 = val(substr(@time,1,2)) and val(substr($time,4,2)) > val(substr(@time,4,2))+54)
;here put what you want to do
endif
endif
endif
something like that.
there is time calculation scripts for exact times too, this is pretty rough, which I think, sits in this situation.