Jump to content

Finding errors in the Event Log


HeXetic
 Share

Recommended Posts

I'm busy putting together a script that will run through the event log and find any errors in the past 24 hours but I'm stuck right at the start. I am able to read one record but how to you get it to move on to another.

Below is just a quick bit of code that I put together to experiment with.

#include <EventLog.au3>

$hEventLog = _EventLog__Open ("", "Application")
$Read = _EventLog__Read($hEventLog, True, False)

$Output = "Did you read the event: " & $Read[0] & @CRLF
$Output &= "The event log ID is : " & $Read[1] & @CRLF
$Output &= "Date and Time: " & $Read[2] & " " & $Read[3] & @CRLF
$Output &= "Error Type: " & $Read[7]

MsgBox(64, "Info", $Output)
Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...