Tue
7
Nov '06
This is a quick script from my hands which logs the date and time of windows ‘loging’ and ‘logoff’.
This is the syntax:
[filename .vbs] LOGIN
[filename .vbs] LOGOFF
dim objfso, objtextfile
set objfso = CreateObject(“Scripting.FileSystemObject”)
set objtextfile = objfso.OpenTextFile(“f:\logsystem.txt”,8,True)
if WScript.Arguments(0) = “LOGIN” then
objtextfile.Write(vbCrLf & Date & ” “ & Time)
else
objtextfile.Write(” - “ & Time)
end if
objTextFile.Close
Wscript.Quit
The output will be like:
11/7/2006 4:15:25 PM - 4:15:27 PM
11/7/2006 4:15:31 PM - 4:15:32 PM
11/7/2006 4:15:34 PM - 4:15:35 PM
11/7/2006 4:15:36 PM
To configure the script in your system you may use “gpedit.msc”. Under “User Configuration” -> “Windows Settings” -> “Scripts(Logon/Logoff)”.This is the syntax:
[filename .vbs] LOGIN
[filename .vbs] LOGOFF

Leave a passing comment »