home *** CD-ROM | disk | FTP | other *** search
- program first; { Program to see if this is the first time the
- computer has been turned on for the first time
- in a day. }
-
- uses
- dos;
- var
- year, month, day, dayofweek : word; { system date }
- f : text;
- d : datetime; { last sign on date }
- srec : searchrec;
-
- BEGIN
- getdate ( year, month, day, dayofweek );
- findfirst ( 'SIGN_ON.BAT', anyfile, srec );
- unpacktime ( srec.time, d);
-
- assign ( f, 'SIGN_ON.BAT' );
- rewrite(f);
-
-
- if ( year = d.year ) and ( month = d.month ) and ( day = d.day ) then
- writeln (f, 'SET FIRST=NO')
- else
- writeln (f, 'SET FIRST=YES');
- close (f);
- END.
-
- { Usage:
- put first in a batch file then run SIGN_ON.BAT, for example
-
- FIRST
- CALL SIGN_ON
- IF %FIRST%==YES goto :first_time_today
- .
- .
- .
- }
-