; * Create the TIMESTAMP
; a TIMESTAMP is not strictly necessary!
IF @MONTHNO < 10
$MONTH= "0" + "@MONTHNO"
ELSE
$MONTH= "@MONTHNO"
ENDIF
IF @MDAYNO < 10
$DAY= "0" + "@MDAYNO"
ELSE
$DAY= "@MDAYNO"
ENDIF
$timestamp = "@YEAR" + "-" + "$MONTH" + "-" + "$DAY" + " " + @TIME
$ComputerName = @WKSTA
$logfile1 = "I:\foldername\auditfile1.txt"
$logfile2 = "I:\foldername\auditfile2.txt"
$Result1 = GetFileTime("C:\Program Files\filename1.txt", 0)
$Result2 = GetFileTime("C:\Program Files\filename2.txt", 0)
$Result1string = "$TIMESTAMP;$ComputerName;$Result1"
$Result2string = "$TIMESTAMP;$ComputerName;$Result2"
? IF Open(3, $logfile1, 4 ) = 0
$x = WriteLine( 3 , $Result1string + Chr(13) + Chr(10) )
if @error
beep
"Failed to write to the darn file. " @error ?
else
"write succeeded." ?
endif
ELSE
BEEP
? "failed to open file, error code : [" + @ERROR + "]"
ENDIF
sleep 2
If Close(3)
Beep
? "Error closing file!"
EndIf
? IF Open(3, $logfile2, 4 ) = 0
$x = WriteLine( 3 , $Result2string + Chr(13) + Chr(10) )
if @error
beep
"Failed to write to the darn file. " @error ?
else
"write succeeded." ?
endif
ELSE
BEEP
? "failed to open file, error code : [" + @ERROR + "]"
ENDIF
sleep 2
exit