The LogEvent method logs an event in the Windows NT event log or WSH.log file.
The LogEvent
method logs an event in the Windows NT event log or WSH.log file. The
type of the event is specified by intType (see details below).
The message string is specified by strMessage. The parameter
strTarget only works on Windows NT. It specifies the name of the
system where the event should be logged (default is local system). This
method returns True if an event is logged sucessfully, otherwise it
returns False.
Event Types/b>
intType
Description
0
SUCCESS
1
ERROR
2
WARNING
4
INFORMATION
8
AUDIT_SUCCESS
16
AUDIT_FAILURE
Set
WshShell = CreateObject("WScript.Shell")
WshShell.LogEvent 4,
"Script started."
.
.
.
WshShell.LogEvent 0, "Script completed."This VBScript code illustrates the behavior of this method.