Sign in to follow this  
Followers 0
wisem2540

Problem reading event log

4 posts in this topic

#include <EventLog.au3>
#include <Array.au3>
$EventLog = _EventLog__Open("", "Application")
 $aEvent = _EventLog__Read($EventLog)
 _ArrayDisplay ($aEVENT)
    _EventLog__Close($EventLog)

this is very basic.  Although the array returned looks legit, it is not an entry in my Application log.  Im sure I am doing something wrong.  (I usually am) but it almost seems like its looking in the wrong place for logs...for example...

From what I can gather, all logs are located in C:\Windows\System32\WinevtLogs

The one I want to read is ACTUALLY called Microsoft-Windows-PrintService%4Admin, but that was doing the same thing, so i thought I would try something simpler.  I first got the idea that something was wrong when I purposely misspelled the name of the log...something like this...  Microsoft-Windows-PrintServi  and it still returned an array...  Could this be an issue with the UDF?  Maybe has something to do with the fact im using 64bit.  I know sometimes the system32 dir and x64 have fits.  Can someone help me test this?

 

Share this post


Link to post
Share on other sites



Can you please post what version of AutoIt, as well as Windows, you are running? The code you have posted works just fine for me; it reads the oldest record.


√-1 2^3 ∑ π, and it was delicious!

Share this post


Link to post
Share on other sites

I am using the latest 3.03.12 with win7 x64. 

I got it working with the application log, however when I try a log with a longer name like Microsoft-Windows-ReadyBoost/Operational, it seems to read something unrelated.

Share this post


Link to post
Share on other sites

Would this be better accomplished with a DLLcall somehow?  Seems like I remember seeing an example like that somewhere.

Share this post


Link to post
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
Sign in to follow this  
Followers 0