that works too.
my script creates 2 lots of log files. one for each computer and one for each user.
the computer one lists which users have used that computer and the user one lists which computers a user has used
on error resume next
'wscript.echo "Logging....."
const ForAppending = 8
dim net,fso,f
Set net = WScript.CreateObject("WScript.Network"

Set fso = CreateObject("Scripting.FileSystemObject"

set wshell = wscript.createobject("wscript.shell"

Set WshSysEnv = WShell.Environment("SYSTEM"
'uname = net.username
uname = wshell.ExpandEnvironmentStrings("%USERNAME%"

'wscript.echo "! " & uname
datetemp = date
ttemp = time
cname = net.ComputerName
'cname = wshell.ExpandEnvironmentStrings("%COMPUTERNAME%"
'path1=list of ppl who have used computer cname
'path2=list of computers person uname has used
'path3=list of shortcuts install in startmenu
path1 = "\\server\logs\" & lcase(cname) & ".txt"
path2 = "\\server\logs\" & lcase(uname) & ".txt"
path3 = "\\server\logs\shortcuts\" & lcase(cname) & ".txt"
If (fso.FileExists(path3)) Then fso.DeleteFile(path3) end if
Set f1 = fs

penTextFile(path1, ForAppending, True)
Set f2 = fs

penTextFile(path2, ForAppending, True)
f1.writeline " was used by " & lcase(uname) & " on " & datetemp & " at " & ttemp
f2.writeline "used computer " & lcase(cname) & " on " & datetemp & " at " & ttemp
if WshSysEnv("OS"

="" then
WShell.Run "%comspec% /c dir " & chr(34) & "c:\windows\start menu\*.lnk" & chr(34) & " /a-d /b /s >> " & path3 ,0,true
end if
f1.close
f2.close
wscript.echo "Logging Done" ===============
Security Forums