Sign in to follow this  
Followers 0
masonje

Windows Event Logging Error

5 posts in this topic

I have a small grp of users who are getting script errors with one of my install scripts that writes to the event log. So just to test on one of the issue PCs, I slapped down a quick "hello world" to see what would happen and I got the same error in the same place. Attached is the error screenshot from the original installer and below is my sample code.

$WshShell = ObjCreate("WScript.Shell")
if @error or $WshShell = 0 Then
    MsgBox(266288,"WshShell","Could not create object.")
    Exit
EndIf

$WshShell.LogEvent(4, "Hello World")

Thoughts on why that user's PC is erroring out and most every one else is fine. Looks like something is wrong with there event logging itself.

post-9485-1160661250_thumb.jpg

Share this post


Link to post
Share on other sites



Do you have a com error handler in your script?

Example:

$oMyError = ObjEvent("AutoIt.Error","MyErrFunc") ; Install a custom error handler 

; Performing a deliberate failure here (object does not exist)
$oIE = ObjCreate("InternetExplorer.Application")
$oIE.visible = 1
$oIE.bogus 
if @error then Msgbox(0,"","the previous line got an error.")

Exit 


; This is my custom error handler 
Func MyErrFunc() 
   $HexNumber=hex($oMyError.number,8) 
   Msgbox(0,"","We intercepted a COM Error !" & @CRLF & _
                "Number is: " & $HexNumber & @CRLF & _
                "Windescription is: " & $oMyError.windescription ) 

   SetError(1) ; something to check for when this function returns 
Endfunc

Who else would I be?

Share this post


Link to post
Share on other sites

No Com error handler. How would I implement that? An adlib?

Share this post


Link to post
Share on other sites

An example was provided.

Do they have a verson of Windows that doesn't support the Event logs? Are they running Internet Explorer 6 with service packs? I found something very strange about Microsoft in that some Windows upgrades require installing a version of Internet Explorer because of the dll modifications it includes.

Share this post


Link to post
Share on other sites

Sorry, I see that now. Sometimes my scripting can be some what linear in thought. I see how it works now.

This installer is actually for XP SP2. Everyone should be up to date with patches and IE6.

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