Share this page 

Write a Window Log EventTag(s): WinAPI/Registry


CONSTANT integer SUCCESS = 0
CONSTANT integer ERROR = 1
CONSTANT integer WARNING = 2 
CONSTANT integer INFORMATION = 4
CONSTANT integer AUDIT_SUCCESS = 8
CONSTANT integer AUDIT_FAILURE = 16 

OLEObject    wsh

wsh = CREATE OLEObject
wsh.ConnectToNewObject( "WScript.Shell" )
wsh.LogEvent( SUCCESS, "Application started" )   
wsh.DisconnectObject()
DESTROY wsh
Note : Logevent can take a third argument which is a computer name where the event log is stored (the default is the local computer system). Applies to Windows NT/2000 only.

In Windows NT/2000, events are logged in the Windows NT Event Log. In Windows 9x/Me, events are logged in WSH.log (located in the Windows directory).