VBScript Write To Event Log

Writing to the event log using vbscript is easy, just create a Shell Object and then call the LogEvent method. The 1st parameter indicates the severity of the event log message. Using the vbscript below, the event is written to the Application Event Log


dim objShell
Set objShell = CREATEOBJECT("WScript.Shell")

' Constants for type of event log entry
' SUCCESS = 0
' ERROR = 1
' WARNING = 2
' INFO = 4
' AUDIT_SUCCESS = 8
' AUDIT_FAILURE = 16

	 
objShell.LogEvent 4, "Info Test"