home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Frostbyte's 1980s DOS Shareware Collection
/
floppyshareware.zip
/
floppyshareware
/
USCX
/
SETPGMS.ZIP
/
NLOG.BAT
< prev
next >
Wrap
DOS Batch File
|
1987-01-15
|
4KB
|
123 lines
echo off
rem .BAT file to log computer usage Copyright 1986 A. B. Krueger GPW MI 48236.
rem Customization section start:
set logdir=c:\$temp
set progdir=c:\utility\
rem Customization section end:
:top
%progdir%setnow
echo Time is now: %time% %date%
if exist %logdir%\oldlog.log goto close
if z%1 == z goto getwho
if z%1 == zin goto getwho
if z%1 == zIN goto getwho
if z%1 == zon goto getwho
if z%1 == zON goto getwho
if z%1 == zout goto notlogged
if z%1 == zOUT goto notlogged
if z%1 == zoff goto notlogged
if z%1 == zOFF goto notlogged
echo Correct parmeters are: OFF and ON. The default is ON.
goto exit
:getwho
rem echo Enter your initials or quit, then ─┘
echo Enter your initials then ─┘
%progdir%setread who /u
rem if z%who% == zQUIT goto exit
if z%who% == zJSK goto gotwho
if z%who% == zDLK goto gotwho
if z%who% == zSAK goto gotwho
if z%who% == zSLK goto gotwho
if z%who% == zABK goto gotwho
echo Only Krueger household initials are accepted, not %who%!!!
goto getwho
:gotwho
if %who% == JSK set username=Joe
if %who% == DLK set username=Dan
if %who% == SAK set username=Sarah
if %who% == SLK set username=Sue
if %who% == ABK set username=Arny
%progdir%setglob username=%username%
echo %username%, please type Business or Pleasure (B or P)
%progdir%setread busplea /u /f
if z%busplea% == zB goto gotbus
if z%busplea% == zP goto gotbus
echo only B or P are allowed
goto gotwho
:gotbus
if %busplea% == B set type=business
if %busplea% == P set type=pleasure
:getdesc
echo %username%, please type a short description of the
echo %type% computer usage planned for this session, then -┘
%progdir%setread desc
:gotdesc
if z%desc% == z goto getdesc
echo %date% %time% %busplea% login %who% %desc% >%logdir%\oldlog.log
echo %date% %time% %busplea% login %who% %desc% >>%logdir%\cumlog.log
echo %date% %time% C checkpoint >%logdir%\newlog.log
echo %username%, you are logged in to do %type% computer usage.
set type=
echo If you change the type of work you are doing, log in again using the
echo LOG command
goto exit
:close
echo Open log entry exists:
type %logdir%\oldlog.log
echo Last log checkpoint data:
type %logdir%\newlog.log
:getsess
if z%1 == zout goto getclose
if z%1 == zOUT goto getclose
if z%1 == zoff goto getclose
if z%1 == zOFF goto getclose
echo Do you wish continue this session? (Y or N)
%progdir%setread answer /u /f
if z%answer% == zY goto exit
if z%answer% == zN goto getclose
echo only Y or N are allowed
goto getsess
:getclose
echo Do you wish to close open log entry with data from checkpoint? (Y or N)
%progdir%setread answer /u /f
if z%answer% == zY goto gotoff
if z%answer% == zN goto getoff
echo only Y or N are allowed
goto getclose
:gotoff
copy %logdir%\cumlog.log+%logdir%\newlog.log /B %logdir%\cumlog.log /B >nul
echo %username%, you are logged out.
goto closej
:getoff
echo Enter time off, or hit -┘ for %time%
%progdir%setread oldtime /u
if z%oldtime% == z set oldtime=%time%
echo Enter date off, or hit -┘ for %date%
%progdir%setread olddate /u
if z%olddate% == z set olddate=%date%
echo %olddate% %oldtime% L logout >>%logdir%\cumlog.log
echo %username%, you are logged out.
:closej
if exist %logdir%\oldlog.log del %logdir%\oldlog.log
if exist %logdir%\newlog.log del %logdir%\newlog.log
if z%1 == z goto getwho
goto exit
:notlogged
echo %username%, You are not currently logged on! No action taken.
:exit
set oldtime=
set olddate=
set who=
set busplea=
set desc=
set progdir=
set answer=