Method:  WshShell.LogEvent

WshShell.LogEvent intType, strMessage [,strTarget]

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.

intType Description
0 SUCCESS
1 ERROR
2 WARNING
4 INFORMATION
8 AUDIT_SUCCESS
16 AUDIT_FAILURE


The following VBScript code illustrates the behavior of this method.

Code:
Set WshShell = CreateObject("WScript.Shell")
WshShell.LogEvent 4, "Script started."
.
.
.
WshShell.LogEvent 0, "Script completed."



Copyright 1999-2001 by Infinite Software Solutions, Inc. All rights reserved.
Trademark Information