Jump to content

Crash after upgrading to 3.3.10.2


mojomatt
 Share

Recommended Posts

  • Administrators

I'm actually surprised the string class didn't handle a null constructor. I was positive I had that sort of thing catered for. Or maybe it used to before I rewrote the string classes from scratch ages ago.

Link to comment
Share on other sites

  • 10 months later...

Is this rly fixed in 3.3.12.0? I read this:

https://www.autoitscript.com/trac/autoit/ticket/2613

But i get this:
 

 

err.description is:     Unspecified error
err.windescription:    Exception occurred.
err.number is:     80020009
err.lastdllerror is:     0
err.scriptline is:     691
err.source is:     SWbemObjectSet
err.helpfile is:     
err.helpcontext is:     0

 

if i query somthing with no result. Somthing like this:

Local $colItems = $objWMIServiceWMI.ExecQuery("SELECT * FROM WmiMonitorID WHERE Active='True'")

If IsObj($colItems) then
    For $objComputer In $colItems
    Next
EndIf

I get the Error direct in the for. I can pre check it :/

Greetings

Mystic

Link to comment
Share on other sites

Have yozu tested with the latest Beta version as well?

My UDFs and Tutorials:

Spoiler

UDFs:
Active Directory (NEW 2024-07-28 - Version 1.6.3.0) - Download - General Help & Support - Example Scripts - Wiki
ExcelChart (2017-07-21 - Version 0.4.0.1) - Download - General Help & Support - Example Scripts
OutlookEX (2021-11-16 - Version 1.7.0.0) - Download - General Help & Support - Example Scripts - Wiki
OutlookEX_GUI (2021-04-13 - Version 1.4.0.0) - Download
Outlook Tools (2019-07-22 - Version 0.6.0.0) - Download - General Help & Support - Wiki
PowerPoint (2021-08-31 - Version 1.5.0.0) - Download - General Help & Support - Example Scripts - Wiki
Task Scheduler (2022-07-28 - Version 1.6.0.1) - Download - General Help & Support - Wiki

Standard UDFs:
Excel - Example Scripts - Wiki
Word - Wiki

Tutorials:
ADO - Wiki
WebDriver - Wiki

 

Link to comment
Share on other sites

Your script is no reproducer so I created the following. It works fine for me with 3.3.12.0 and 3.3.13.19

Local $sComputer = ""
Local $objWMI = ObjGet('winmgmts:' & $sComputer & '\root\CIMV2')
Local $colItems = $objWMI.ExecQuery("SELECT * FROM WmiMonitorID WHERE Active='True'")
If IsObj($colItems) Then
    For $objComputer In $colItems
        ConsoleWrite("**" & @CRLF)
    Next
EndIf

My UDFs and Tutorials:

Spoiler

UDFs:
Active Directory (NEW 2024-07-28 - Version 1.6.3.0) - Download - General Help & Support - Example Scripts - Wiki
ExcelChart (2017-07-21 - Version 0.4.0.1) - Download - General Help & Support - Example Scripts
OutlookEX (2021-11-16 - Version 1.7.0.0) - Download - General Help & Support - Example Scripts - Wiki
OutlookEX_GUI (2021-04-13 - Version 1.4.0.0) - Download
Outlook Tools (2019-07-22 - Version 0.6.0.0) - Download - General Help & Support - Wiki
PowerPoint (2021-08-31 - Version 1.5.0.0) - Download - General Help & Support - Example Scripts - Wiki
Task Scheduler (2022-07-28 - Version 1.6.0.1) - Download - General Help & Support - Wiki

Standard UDFs:
Excel - Example Scripts - Wiki
Word - Wiki

Tutorials:
ADO - Wiki
WebDriver - Wiki

 

Link to comment
Share on other sites

Ok sry my sniped was a bit to small i think. It looks like the error-event is the Problem :/

Global $oIEErrorHandler = ObjEvent("AutoIt.Error", "MyErrFunc")

; Datumswerte ermitteln
Global $DATUM = @YEAR & "-" & @MON & "-" & @MDAY
Global $ZEIT = @HOUR & ":" & @MIN & ":" & @SEC
Global $ZEITDATEI = @HOUR & "_" & @MIN & "_" & @SEC
Global $INIFILE = "test.ini"

#region WMI-Part
Local Const $wmiNamespace = "root\WMI"
Local $wbemFlagReturnImmediately=0x10
Local $wbemFlagForwardOnly=0x20
Local $objWMIServiceWMI = ObjGet("winmgmts:\\" & @ComputerName & "\" & $wmiNamespace)

If Not @error And IsObj($objWMIServiceWMI) Then

    ; Aktive Monitore abfragen
    Local $colItems = $objWMIServiceWMI.ExecQuery("SELECT * FROM WmiMonitorID WHERE Active='True'", "WQL", _
                                                  $wbemFlagReturnImmediately + $wbemFlagForwardOnly)

    If IsObj($colItems) Then
        MsgBox ( 0, "Test Script", "Start")

        For $objComputer In $colItems
            MsgBox ( 0, "Test Script", "Monitor")
        Next

        MsgBox ( 0, "Test Script", "Ende")
    EndIf
 EndIf
 #EndRegion

#region MyErrFunc
Func MyErrFunc($oError)
    Local $HexNumber = hex($oError.number,8)

    Local $Output = "err.description is: "    & @TAB & $oError.description      & @CRLF & _
                    "err.windescription:"     & @TAB & $oError.windescription   & @CRLF & _
                    "err.number is: "         & @TAB & $HexNumber               & @CRLF & _
                    "err.lastdllerror is: "   & @TAB & $oError.lastdllerror     & @CRLF & _
                    "err.scriptline is: "     & @TAB & $oError.scriptline       & @CRLF & _
                    "err.source is: "         & @TAB & $oError.source           & @CRLF & _
                    "err.helpfile is: "       & @TAB & $oError.helpfile         & @CRLF & _
                    "err.helpcontext is: "    & @TAB & $oError.helpcontext _

    Local $file = FileOpen("Error_" & @ComputerName & "_" & $DATUM & "_" & $ZEITDATEI & "_" & Int(Random(1, 1000)) & ".clstartup.dat", 1)

    If $file <> -1 Then
        FileWrite($file, $Output)
        FileClose($file)
    EndIf

    IniWrite($INIFILE, "ini", "wmi", "False")
    IniWrite($INIFILE, "Error", "LastError", $DATUM & " " & $ZEIT)
    IniWrite($INIFILE, "Error", "Scriptline", $oError.scriptline)
    Exit

EndFunc   ;==>MyErrFunc
#EndRegion
If i run this Script on my Windows 7 or Windows 8 Clients i get 3 Messageboxes (Start + Monitor + End) without Error-File.

If i run this script on an 2008 Server i get only the "Start" with Error-File.

If i comment out the first line i runes on the 2008 Server to like on Windows 7 and Windows 8. And i dont know why :/

 

And Error is every time the same:

 

err.description is:     

err.windescription:    

err.number is:     8004100C

err.lastdllerror is:     0

err.scriptline is:     24

err.source is:     

err.helpfile is:     

err.helpcontext is:

*EDIT*

I found somthing:

http://stackoverflow.com/questions/26851511/vbscript-swbemobjectset-error-8004100c

8004100c on swbemobjectset means "Not supported". But how could i catch this. Actual my Script exit if it get COM-Error. But it looks this Error is fine. But i cant handle it because @error would not bet set after ExecQuery :/

WmiMonitorID get suppored with Vista and Server 2008:

http://msdn.microsoft.com/en-us/library/aa394542%28v=vs.85%29.aspx

so dont know why this dont work. But i think it looks like not the Error from the base Thread sry :(

Edited by MysticEmpires
Link to comment
Share on other sites

8004100c on swbemobjectset means "Not supported". But how could i catch this. Actual my Script exit if it get COM-Error. But it looks this Error is fine. But i cant handle it because @error would not bet set after ExecQuery :/

That's easy ;)

Do not exit the script in MyErrFunc. If you do a simple Return the script continues with the next line of code.

My UDFs and Tutorials:

Spoiler

UDFs:
Active Directory (NEW 2024-07-28 - Version 1.6.3.0) - Download - General Help & Support - Example Scripts - Wiki
ExcelChart (2017-07-21 - Version 0.4.0.1) - Download - General Help & Support - Example Scripts
OutlookEX (2021-11-16 - Version 1.7.0.0) - Download - General Help & Support - Example Scripts - Wiki
OutlookEX_GUI (2021-04-13 - Version 1.4.0.0) - Download
Outlook Tools (2019-07-22 - Version 0.6.0.0) - Download - General Help & Support - Wiki
PowerPoint (2021-08-31 - Version 1.5.0.0) - Download - General Help & Support - Example Scripts - Wiki
Task Scheduler (2022-07-28 - Version 1.6.0.1) - Download - General Help & Support - Wiki

Standard UDFs:
Excel - Example Scripts - Wiki
Word - Wiki

Tutorials:
ADO - Wiki
WebDriver - Wiki

 

Link to comment
Share on other sites

After the statement that triggers the COM error simply query macro @error

Global $oErrorHandler = ObjEvent("AutoIt.Error", "MyErrFunc")

Local $colItems = $objWMIServiceWMI.ExecQuery("SELECT * FROM WmiMonitorID WHERE Active='True'", "WQL", _
    $wbemFlagReturnImmediately + $wbemFlagForwardOnly)
If @error Then Exit MsgBox(0, "Error", "Error occurred!")

; Rest of code when no error

Exit

Func MyErrFunc($oError)
EndFunc   ;==>MyErrFunc

My UDFs and Tutorials:

Spoiler

UDFs:
Active Directory (NEW 2024-07-28 - Version 1.6.3.0) - Download - General Help & Support - Example Scripts - Wiki
ExcelChart (2017-07-21 - Version 0.4.0.1) - Download - General Help & Support - Example Scripts
OutlookEX (2021-11-16 - Version 1.7.0.0) - Download - General Help & Support - Example Scripts - Wiki
OutlookEX_GUI (2021-04-13 - Version 1.4.0.0) - Download
Outlook Tools (2019-07-22 - Version 0.6.0.0) - Download - General Help & Support - Wiki
PowerPoint (2021-08-31 - Version 1.5.0.0) - Download - General Help & Support - Example Scripts - Wiki
Task Scheduler (2022-07-28 - Version 1.6.0.1) - Download - General Help & Support - Wiki

Standard UDFs:
Excel - Example Scripts - Wiki
Word - Wiki

Tutorials:
ADO - Wiki
WebDriver - Wiki

 

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