Jump to content

MysticEmpires

Members
  • Posts

    4
  • Joined

  • Last visited

MysticEmpires's Achievements

Seeker

Seeker (1/7)

0

Reputation

  1. I know But normaly i would exit on COM-Errors. I need somthing like a try Catch
  2. 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: *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
  3. Is this rly fixed in 3.3.12.0? I read this: https://www.autoitscript.com/trac/autoit/ticket/2613 But i get this: 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
  4. There is a bug in the Function "_FindMonitorName". EDID allow mutible Discriptionblocks. A Sample : EDID : 00ffffffffffff003ac4000e000000002d0c010380201400eaa8e099574b92251c5054000000010101010101010101010101010101016c2f90a0601a1e403020260042c910000018000000fc004e76696469612044656661756c000000fc007420466c61742050616e656c00000000fd00003c1d430d000020202020200000540000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000 Descriptor Block 1 : Pixel Clock Descriptor Block 2 : Monitorname Part 1(Nvidia Defaul) Descriptor Block 3 : Monitorname Part 2 (t Flat Panel) Descriptor Block 4 : Monitor Range Limits The old Version of the Function return : "t Flat Panel" the new Return : "Nvidia Default Flat Panel" Func _FindMonitorName(ByRef $aArray); Thanks archrival If Not IsArray($aArray) Then Return Local $n = 0, $sNamestr = "", $iEndstr = 0 For $i = 1 To (UBound($aArray) / 2) - 4 If $aArray[$i] = "0" And $aArray[$i + 1] = "0" And _ $aArray[$i + 2] = "252" And $aArray[$i + 3] = "0" Then $n = $i + 3 For $in = 1 To 13 If $aArray[$n + $in] = "10" Then $iEndstr = 1 ElseIf Not $iEndstr Then $sNamestr &= Chr($aArray[$n + $in]) EndIf Next EndIf Next If Not $n Then Return "Not Found" EndIf Return $sNamestr EndFunc ;==>_FindMonitorName
×
×
  • Create New...