Jump to Real's How-to Main page

Write a Window Log Event

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).


If you find this article useful, consider making a small donation
to show your supportfor this Web site and its content.

Written and compiled by Réal Gagnon ©1998-2005
[ home ]