Björn,

Quote from the shoutbox:
 Quote:

[Les] LOL... I didn't want to pee in your Cornflakes but you have vars in strings... tsk, tsk


Just to be sure Les stops peeing in your cornflakes I changed the fnWriteLog function a bit.
All vars and macro's are no longer in between quotes. I also added the ExpandEnvironmentVars to the path for the log file.

 Code:
Function fnWriteLog($text)
   Dim $rc, $loglile, $filehandle
   $filehandle = "7"
   $logfile = ExpandEnvironmentVars(%temp%) + "\logon.log"
   $rc = WriteLine ($filehandle, @Date + " " + @Time " - " + $text + @CRLF)
   If $rc < 0
      $rc = Close ($filehandle)
      $rc = Open ($filehandle, $logfile, 5)
      Select
         Case $rc = -1
            $rc = MessageBox ("Invalid file name (" + $fogfile + ") specified for log file.","Logon Script Error",48)
         Case $rc = 0
            fnWriteLog ($text)
         Case $rc => 0
            $rc = MessageBox ("Error(" + $rc + ") while attempting to open log file (" + $logfile + ").","Logon Script Error",48)
      EndSelect
   EndIf
EndFunction


If I'm going to use it in my production environment I would add some lines that would mail the log to the admin(s) if there were more then 0 errors. On every logon I'd check for the existence of the log file and delete it if it exists.
_________________________
Mart

- Chuck Norris once sold ebay to ebay on ebay.