Hi All,

I've just stumbled back into Kix after a 6 month leave of absence. I am currently writing a script to roll-out Windows NT SP6a and have written a file to audit a users' PC.

code:
$AuditFile=("s:\Logs\audit.csv")
$IEVersion = ReadValue("HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Internet Explorer","Version")
$Freespace=GetDiskSpace (C:)
If Open( 3 , $AuditFile , 5 ) = 0
WriteLine( 3 , "@DATE,@TIME,@WKSTA,@USERID,@FULLNAME,$FREESPACE Kb,@PRODUCTTYPE @CSD,Internet Explorer $IEVERSION @CRLF")
Else
Beep
? "failed to open file, error code : [" + @ERROR + "]"
EndIf

Now to avoid the issue of a PC not running the audit if the file is being written to by another user I want to include a WHILE-LOOP but don't know where to put it. Can anyone help ?

Cheers,
Grasshopper75