Hi all

I've tried a few tweaks and to simplify the code - the latest effort is below, but I still can't get the little b***** to play ball & do the job.

getting very frustrated with this one

Thanks from one kixtart novice


Code:
; * 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)   

IF Open( 3 , "I:\foldername\auditfile1.txt" , 5 ) = 0
  $x = WriteLine( 3 , $TIMESTAMP;$ComputerName;$Result1 + Chr(13) + Chr(10) )
ELSE
  BEEP
  ? "failed to open file, error code : [" + @ERROR + "]"
ENDIF

If Close(3)
  Beep
  ? "Error closing file!"
EndIf

IF Open( 3 , "I:\foldername\auditfile2.txt" , 5 ) = 0
  $x = WriteLine( 3 , $TIMESTAMP;$ComputerName;$Result2 + Chr(13) + Chr(10) )
ELSE
  BEEP
  ? "failed to open file, error code : [" + @ERROR + "]"
ENDIF

If Close(3)
  Beep
  ? "Error closing file!"
EndIf


exit