February 11, 2014

Reading from System Event Logs

Filed under: General,Scripting — Marcus Tettmar @ 3:08 pm

Just been asked how to read from the system event log (what you see in Windows Event Viewer) using Macro Scheduler.

As it happens there’s already an example of monitoring the event log for specific event types and responding to them in the Scripts n Tips forum here.

So I’ve taken that code and modified it slightly to return a list of all entries for a given event code.  Here is the script:

Although I’ve added code to allow you to retrieve ALL events I would not advise it as that could take A. VERY. LONG. TIME.

I’ve added this example into the Scripts n Tips forum.  Here.