Jump to content

Leaderboard

Popular Content

Showing content with the highest reputation on 01/27/2023 in all areas

  1. Local $aArray = _Excel_RangeRead($oExcel, Default) should be Local $aArray = _Excel_RangeRead($oWorkbook1, Default) as the function requires the workbook object as first parameter Plus For $i=1 To $aArray[0][0] RunWait($aArray[$i][1]) Next should be For $i=0 To UBound($aArray) - 1 RunWait($aArray[$i][1]) Next as the new Excel UDF now returns a 0-based array. Since 2015 the Excel UDF has been completely rewritten. What has changed can be found here.
    2 points
  2. spudw2k

    Is it even possible ?

    This might be of interest / use to you:
    2 points
  3. spudw2k

    System Scan Report Tool

    Was revisiting an old script I made for work years ago; it performs a local system scan and produces an HTML report. the report was very basic and ugly...now it's less ugly, so I thought I'd share. It collects system info (i.e. manufacturer, model, serial, CPU, RAM, BIOS ver., etc.), network card info, a device list & installed software list. Requires DeviceAPI.au3 UDF by Weaponx #NoTrayIcon ;#RequireAdmin #Region ;**** Directives created by AutoIt3Wrapper_GUI **** #AutoIt3Wrapper_UseX64=n #AutoIt3Wrapper_Res_Fileversion=0.2.2.0 ;#AutoIt3Wrapper_Res_requestedExecutionLevel=asInvoker #AutoIt3Wrapper_Run_Obfuscator=y #Obfuscator_Parameters=/cs=0 /cn=0 /cf=0 /cv=0 /sf=1 /sv=1 #EndRegion ;**** Directives created by AutoIt3Wrapper_GUI **** #NoAutoIt3Execute Global $version = "0.2.2" #cs - Version History 0.2.2 Bug fix [*] Corrected _WriteArrayToLog() destination file for debug 0.2.1 Minor Updates [+] Added System Info Attributes (OS, OS Version, Organization and Registered Owner) 0.2.0 Misc Updates [+] HTML Report Format - Initial Bootstrap CSS support [*] Minor report changes [*] Changed log write logic 0.1.5 Minor Updates [+] Added Obfuscation to Reduce Script Size [+] Set FileVersion to Match Script Version [+] Disabled external AutoIt script/code execution. 0.1.4 Significant Updates / Script Cleanup [-] Removed Omitted code from version 0.1.3 [*] Code Cleanup [*] Optimized Network Info WMI Query [+] Added HTML Footer [*] Changed HTML Report Header and added timestamps [*] Changed Script name to SystemScan 0.1.3 Major Updates / Script Cleanup & HTML Report [-] Removed Omitted code from version 0.1.2 [+] Added HTML Report Functions [+] Added Data Array Sort [*] Omitted Software & Device Hash Checking and Scan Force and Scan Version Reg Key [*] Omitted Uninstall String 0.1.2 Minor Updates / Script Cleanup [*] Changed All Collection Functions to Output Data Arrays [+] Created Array to Log File Method [-] Removed TimeZone from System Info Collection [*] Omitted User Name from System Info Collection [*] Omitted GUID Generation [*] Changed Scan Force to not remove or check Software and Device Signatures [*] Misc Code Cleanup [*] Omitted Software install date conversions 0.1.1 Minor Updates / Script Cleanup 0.1 Alpha Build #ce #Region - Initialization ;#AutoIt3Wrapper_Change2CUI=Y #include <Array.au3> ;Include Native AutoIt Library for Array Functions #include <DeviceAPI.au3> ;By Weaponx - https://www.autoitscript.com/forum/topic/77731-device-management-api/ #include <Constants.au3> ;Include Native AutoIt Library for AutoIt Constants #include <Date.au3> ;Include Native AutoIt Library for Date/Time Functions #include <Misc.au3> ;Include Native AutoIt Library for Misc. Functions (_Singleton()) ;Initialize Global $exitTimer = 0, $host = @ComputerName, $debug = 0 ;Define Global Variables for Timer, Hostname & Debug Flags Global $destDir = @ScriptDir & "\" ;Define LogFile Destination If Not _Singleton("DomainScan") Then Exit ;Enforce Singleton Execution If Not FileExists($destDir) Then DirCreate($destDir) ;Create Destination Dir Local $log = $destdir & "\" & @ComputerName & ".htm" $log = FileOpen($log, 2) FileDelete($destDir & "DomainScanLog.txt") ;Remove Debug Logfile ;Parse Command-Line Arguments for Debug and ScanForce Options If $CMDLINE[0] Then If StringInStr($CMDLINERAW, "debug") Then $debug = 1 ;Unused Function with Example Usage ;If StringInstr($CMDLINERAW,"/fileinfolist") Then ;domainscan.exe /fileinfolist "C:\dir\file.txt" ;_FileInfoList($CMDLINE[$CMDLINE[0]]) ;EndIf EndIf ;==>Initialize #EndRegion - Initialization #Region - Main ;Establish Local WMI Connection $oMyError = ObjEvent("AutoIt.Error", "MyErrFunc") $objWMIService = ObjGet("winmgmts:{impersonationLevel=impersonate}!\\.\root\cimv2") If Not IsObj($objWMIService) Then If $debug Then _DebugLog("Failed to Establish WMI Connection") _Exit() EndIf If $debug Then _DebugLog("Established WMI Connection") ;==>Establish WMI Connection ;Timeout Timer $exitTimer = TimerInit() AdlibRegister("_ExitTimer", 30000) OnAutoItExitRegister("_Exit") ;==>Timeout Timer ;Collect System Data _WriteHTMLReportHeader($destDir) _AddSystemInfo($host) _AddSystemNetworkInfo($host) _AddSystemDevices($host) _AddSystemInstalledSoft($host) _WriteHTMLReportFooter($destDir) _Exit() ;==>Collect System Data ;Save log to NAS ;==>Save log to NAS #EndRegion - Main #Region - User Defined Functions Func _AddSystemInfo($hostname) ;Collect System Information If $debug Then _DebugLog("Collecting System Information") ;Execute WMI Queries $colItems = $objWMIService.ExecQuery("SELECT Name FROM Win32_Processor") For $objItem In $colItems $CPU = StringLeft(StringStripWS($objItem.name, 7), 64) Next $colItems = $objWMIService.ExecQuery("SELECT SerialNumber, SMBIOSBIOSVersion, ReleaseDate FROM Win32_BIOS") For $objItem In $colItems $Serial = $objItem.SerialNumber $BIOSVer = $objItem.SMBIOSBIOSVersion $ManufactureDate = $objItem.ReleaseDate $RealDate = ObjCreate("WbemScripting.SWbemDateTime") $RealDate.value = $ManufactureDate $ManufactureDate = StringRegExpReplace($RealDate.GetVarDate, "(\d{4,4})(\d{2,2})(\d{2,2})(\d{2,2})(\d{2,2})(\d{2,2})", "$2\/$3\/$1 $4:$5") $RealDate = 0 Next $colItems = $objWMIService.ExecQuery("SELECT TotalPhysicalMemory, Manufacturer, Model, Domain, UserName FROM Win32_ComputerSystem") For $objItem In $colItems $RAM = Round($objItem.TotalPhysicalMemory / 1024 / 1024) $Manufacturer = $objItem.Manufacturer $Model = StringLeft(StringStripWS($objItem.Model, 2), 30) $Domain = StringLeft($objItem.Domain, StringInStr($objItem.Domain, ".") - 1) Next $colItems = $objWMIService.ExecQuery("SELECT Caption, Version, Organization, RegisteredUser, LastBootUpTime, CurrentTimeZone FROM Win32_OperatingSystem") For $objItem In $colItems $OS = $objItem.Caption $OSVersion = $objItem.Version $Organization = $objItem.Organization $RegisteredUser = $objItem.RegisteredUser $LastBootTime = $objItem.LastBootUpTime $RealDate = ObjCreate("WbemScripting.SWbemDateTime") $RealDate.value = $LastBootTime $LastBootTime = StringRegExpReplace($RealDate.GetVarDate, "(\d{4,4})(\d{2,2})(\d{2,2})(\d{2,2})(\d{2,2})(\d{2,2})", "$2\/$3\/$1 $4:$5") $RealDate = 0 Next $colItems = 0 ;Collect Local Administrator Members $localadmins = "" Dim $filter[1] = ["Groups"] $colGroups = ObjGet("WinNT://" & $hostname & "") $colGroups.Filter = $filter For $objGroup In $colGroups If $objGroup.Name = "Administrators" Then For $objUser In $objGroup.Members If $objUser.Name Then $localadmins &= $objUser.Name & "|" Next EndIf Next If StringRight($localadmins, 1) = "|" Then $localadmins = StringTrimRight($localadmins, 1) $localadmins = StringLeft($localadmins, 255) ;Create Data Array Dim $arrSysInfo[2][14] = [["OS", "OS Version", "Owner", "Organization", "Manufacturer", "Model", "Serial", "BIOS Version", "BIOS Date", "CPU", "RAM", "Domain", "Last Boot Time", "Local Admins"], _ [$OS, $OSVersion, $RegisteredUser, $Organization, $Manufacturer, $Model, $Serial, $BIOSVer, $ManufactureDate, $CPU, $RAM, $Domain, $LastBootTime, $localadmins]] ;Save Collected Info If $debug Then _WriteArrayToLog($arrSysInfo, $destDir, "SystemInfo.CSV") $arrSysInfo[1][13] = StringReplace($arrSysInfo[1][13], "|", "</br>") _WriteArrayToHTML(__ArrayTranspose($arrSysInfo), $destDir, "System Information") If $debug Then _DebugLog("System Information Collected") EndFunc ;==>_AddSystemInfo Func _AddSystemNetworkInfo($hostname) ;Collect System Network Information If $debug Then _DebugLog("Collecting System Network Information") ;Execute WMI Queries Dim $arrNetInfo[1][8] = [["Interface Name", "MAC", "IP", "Subnet", "Gateway", "DNS1", "DNS2", "WINS"]] Dim $netIdx = 1 $colItems = $objWMIService.ExecQuery("SELECT IPAddress, Description, MACAddress, IPSubnet, DefaultIPGateway, DNSServerSearchOrder, WINSPrimaryServer FROM Win32_NetworkAdapterConfiguration Where IPEnabled = True") For $objItem In $colItems If $objItem.IPAddress(0) <> "0.0.0.0" Then $NIC = StringLeft($objItem.Description, 90) $MAC = $objItem.MACAddress $IP = $objItem.IPAddress(0) $Subnet = $objItem.IPSubnet(0) $Gateway = $objItem.DefaultIPGateway(0) $DNS1 = $objItem.DNSServerSearchOrder(0) $DNS2 = $objItem.DNSServerSearchOrder(1) $WINS = $objItem.WINSPrimaryServer(0) ReDim $arrNetInfo[$netIdx + 1][8] $arrNetInfo[$netIdx][0] = $NIC $arrNetInfo[$netIdx][1] = $MAC $arrNetInfo[$netIdx][2] = $IP $arrNetInfo[$netIdx][3] = $Subnet $arrNetInfo[$netIdx][4] = $Gateway $arrNetInfo[$netIdx][5] = $DNS1 $arrNetInfo[$netIdx][6] = $DNS2 $arrNetInfo[$netIdx][7] = $WINS $netIdx += 1 EndIf Next $colItems = 0 _ArraySort($arrNetInfo, 0, 1, UBound($arrNetInfo) - 1) ;Save Collected Data If $debug Then _WriteArrayToLog($arrNetInfo, $destDir, "NetworkInfo.CSV") _WriteArrayToHTML(__ArrayTranspose($arrNetInfo), $destDir, "Network Information") If $debug Then _DebugLog("System Network Information Collected") EndFunc ;==>_AddSystemNetworkInfo Func _AddSystemInstalledSoft($hostname) ;Collect Installed Software Listing If $debug Then _DebugLog("Collecting Installed Software") ;Populate Software Collection Array Dim $arrSoft[1][3] = [["Software Title", "Version", "Install Date"]] Dim $appIdx = 1 If @OSArch <> "X64" Then $y = 1 Else $y = 2 EndIf For $x = 1 To $y $keyIdx = 0 ;Index of Uninstall SubKeys If $x = 1 Then $regRoot = "HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall" ;Registry Tree for Uninstall Info Else $regRoot = "HKLM64\SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall" ;Registry Tree for Uninstall Info EndIf While 1 $keyIdx += 1 ;Increment Index each loop $keyName = RegEnumKey($regRoot, $keyIdx) ;Query Registry Key at Index $keyIdx If @error Then ExitLoop ;If not end of registry tree Local $appName = StringLeft(StringStripWS(RegRead($regRoot & "\" & $keyName, "DisplayName"), 7), 80) ;Get Application Name If $appName Then Local $versionNum = RegRead($regRoot & "\" & $keyName, "DisplayVersion") ;Get Version Number Local $installdate = RegRead($regRoot & "\" & $keyName, "InstallDate") ;Get Install Date If Not $versionNum Then $versionNum = "" ReDim $arrSoft[$appIdx + 1][3] $arrSoft[$appIdx][0] = $appName $arrSoft[$appIdx][1] = $versionNum $arrSoft[$appIdx][2] = $installdate $appIdx += 1 EndIf WEnd Next _ArraySort($arrSoft, 0, 1, UBound($arrSoft) - 1) If $debug Then _DebugLog("Adding System Software") ;Save Collected Info If $debug Then _WriteArrayToLog($arrSoft, $destDir, "Software.CSV") _WriteArrayToHTML($arrSoft, $destDir, "Installed Software") EndFunc ;==>_AddSystemInstalledSoft Func _AddSystemDevices($hostname) ;Collect Installed System Devices If $debug Then _DebugLog("Collecting System Devices") ;Populate Installed System Devices Array Dim $arrHW[1][3] = [["Device Name", "Class", "Manufacturer"]] $devIDX = 1 _DeviceAPI_Open() _DeviceAPI_GetAllDevices() ;Build list of ALL device classes While _DeviceAPI_EnumDevices() ReDim $arrHW[$devIDX + 1][3] $arrHW[$devIDX][0] = _DeviceAPI_GetDeviceRegistryProperty($SPDRP_DEVICEDESC) $arrHW[$devIDX][1] = _DeviceAPI_GetClassName(_DeviceAPI_GetDeviceRegistryProperty($SPDRP_CLASSGUID)) $arrHW[$devIDX][2] = _DeviceAPI_GetDeviceRegistryProperty($SPDRP_MFG) $devIDX += 1 WEnd _DeviceAPI_DestroyDeviceInfoList() ;Cleanup for good measure _DeviceAPI_Close() _ArraySort($arrHW, 0, 1, UBound($arrHW) - 1) If $debug Then _DebugLog("Adding System Devices") ;Save Collected Info If $debug Then _WriteArrayToLog($arrHW, $destDir, "Devices.CSV") _WriteArrayToHTML($arrHW, $destDir, "System Devices") EndFunc ;==>_AddSystemDevices Func __ArrayTranspose(ByRef $arr) If Not IsArray($arr) Then Return SetError(1, 0, 0) If Not UBound($arr, 0) = 2 Then Return SetError(2, 0, 0) Dim $arrTrans[UBound($arr, 2)][UBound($arr, 1)] For $x = 0 To UBound($arrTrans, 2) - 1 For $y = 0 To UBound($arrTrans) - 1 $arrTrans[$y][$x] = $arr[$x][$y] Next Next Return $arrTrans EndFunc ;==>__ArrayTranspose Func _DebugLog($str) FileWriteLine($destDir & "DomainScanLog.txt", @HOUR & ":" & @MIN & ":" & @SEC & " - " & $str) EndFunc ;==>_DebugLog Func _Exit() $exitTimer = 0 $objWMI = 0 FileClose($log) Exit EndFunc ;==>_Exit Func _ExitTimer() $time = 1200000 If $debug Then _DebugLog("Timer Check: " & TimerDiff($exitTimer) & @TAB & $time) If TimerDiff($exitTimer) > $time Then Exit EndFunc ;==>_ExitTimer Func _Today() Return @YEAR & @MON & @MDAY EndFunc ;==>_Today Func _WriteArrayToHTML($arr, $dest, $title) $xDim = UBound($arr, 1) - 1 $yDim = UBound($arr, 2) - 1 FileWriteLine($log, "<div class=""container""><h3><a href='#" & StringReplace($title," ","_") & "' data-toggle='collapse'>" & $title & "</a></h3>") FileWriteLine($log, "<div id='" & StringReplace($title," ","_") & "' class='collapse'><table border='0'>") $varRowColor = 0 For $x = 0 To $xDim If $varRowColor = 0 Then $varRowColor = 1 $varRowColorValue = "#9BCDFF" Else $varRowColor = 0 $varRowColorValue = "#C4E1FF" EndIf FileWrite($log, "<tr bgcolor='" & $varRowColorValue & "'>") For $y = 0 To $yDim FileWrite($log, "<td>" & $arr[$x][$y] & "</td>") Next FileWrite($log, "</tr>" & @CRLF) Next FileWriteLine($log, "</table></div></div></br>") EndFunc ;==>_WriteArrayToHTML Func _WriteArrayToLog($arr, $dest, $filename) $xDim = UBound($arr, 1) - 1 $yDim = UBound($arr, 2) - 1 For $x = 0 To $xDim For $y = 0 To $yDim FileWrite($destdir & "\" & @ComputerName & "_" & $filename, '"' & $arr[$x][$y] & '"') If $y < $yDim Then FileWrite($destdir & "\" & @ComputerName & "_" & $filename, ",") Else FileWrite($destdir & "\" & @ComputerName & "_" & $filename, @CRLF) EndIf Next Next EndFunc ;==>_WriteArrayToLog Func _WriteHTMLReportHeader($dest) $title = @ComputerName & " System Scan" FileWriteLine($log, '<link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/4.0.0/css/bootstrap.min.css" integrity="sha384-Gn5384xqQ1aoWXA+058RXPxPg6fy4IWvTNh0E263XmFcJlSAwiGgFAW/dAiS6JXm" crossorigin="anonymous">') FileWriteLine($log, '<script src="https://ajax.googleapis.com/ajax/libs/jquery/3.3.1/jquery.min.js"></script>') FileWriteLine($log, '<script src="https://cdnjs.cloudflare.com/ajax/libs/popper.js/1.14.3/umd/popper.min.js"></script>') FileWriteLine($log, '<script src="https://maxcdn.bootstrapcdn.com/bootstrap/4.1.3/js/bootstrap.min.js"></script>') FileWriteLine($log, "<title>" & $title & "</title>" & @CRLF & _ "<div class=""jumbotron jumbotron-fluid""><div class=""container""><center><h1>" & $title & "</h1></div></div>" & _ "<div class=""container"">Scan Initiated: " & @MON & "/" & @MDAY & "/" & @YEAR & " " & @HOUR & ":" & @MIN & ":" & @SEC & "</br></br></br></div>") EndFunc ;==>_WriteHTMLReportHeader Func _WriteHTMLReportFooter($dest) FileWriteLine($log, "</div></br><div class=""container"">Scan Complete: " & @MON & "/" & @MDAY & "/" & @YEAR & " " & @HOUR & ":" & @MIN & ":" & @SEC & "</div>") FileClose($log) ShellExecute($dest & "\" & @ComputerName & ".htm") EndFunc ;==>_WriteHTMLReportFooter Func MyErrFunc() If $oMyError.number = -2147352567 Then Return 0 If $debug Then _DebugLog("Intercepted a COM Error !" & @CRLF & @CRLF & "err.description is: " & @TAB & $oMyError.description) Local $err = $oMyError.number If $err = 0 Then $err = -1 $g_eventerror = $err ; to check for after this function returns EndFunc ;==>MyErrFunc #EndRegion - User Defined Functions #Region - Functions Not Implemented ;Func _AddFileInfo($hostname,$file) ; If Not FileExists($file) Then Return 0 ; $attribs = FileGetAttrib($file) ; $size = FileGetSize($file) ; $version = FileGetVersion($file) ; $modtime = FileGetTime($file,0,1) ; $cretime = FileGetTime($file,1,1) ; $acctime = FileGetTime($file,2,1) ;EndFunc ;Func _FileInfoList($filelist) ; If Not FileExists($filelist) Then Return 0 ; Dim $arrList ; _FileReadToArray($filelist,$arrList) ; For $x = 1 to $arrList[0] ; ;_AddFileInfo(@ComputerName,$arrList[$x]) ; Next ;EndFunc #EndRegion - Functions Not Implemented The script produces a report that looks like this.
    1 point
  4. ptrex

    COM Midi-OX Scripting

    What is MIDI-Scripting? First, a little explanation on what you can do with MIDI-Scripts. You can write a script that tells MIDI Device how to act based on the MIDI input message it receives. Or the other way around you can send MIDI messages from a MIDI Device to a MIDI compatible software, And script the behavior accordingly. Writing your own MIDI-Script allows you to execute custom actions, such as play/pause, start/stop recording, .... MIDI protocol The protocol is based on messages. A MIDI message is an instruction that controls some aspect of the receiving Device. You have short messages (3 bytes) and system Exclusive messages (byte arrays). the exclusive messages are also called SysEx messages. Why needing this? Apart from controlling music device, you can also you this controlling other types of devices and even software. Most of them are music media related. AutoIt MIDI software : - MIDI library - Peace Equalizer MIDI-OX Com library : MIDI-OX is a versatile utility that is great for troubleshooting MIDI hardware devices. It also acts as a System Exclusive SysEx librarian, which allows you to send (dump) and receive SysEx data. Nevertheless this is quite old software, it is still alive and kicking. Mentioned many times on the internet as the Swiss Army knife for debugging input and output MIDI messages. It has a GUI interface but as well is has COM interface. Download here : I wrote a quick example to convert the it to AutoIT #AutoIt3Wrapper_UseX64=N #include <MsgBoxConstants.au3> ; Initialize SvenP 's error handler $oMyError = ObjEvent("AutoIt.Error","MyErrFunc") ;~ Create object Local $mox = ObjCreate("MIDIOX.MOXScript.1") ; Custom sink object Local $oMoxEvents = ObjEvent($mox, "OnTrigger_") Local $Now = $mox.GetSystemTime $mox.Sleep(2500) If $mox.GetSystemTime Then ConsoleWrite("At least 2½ second has passed" & @CRLF) EndIf Local $n1 = $mox.InstanceCount Local $n2 = $mox.InstanceNumber ConsoleWrite("Instances : " & $n2 & " " & $n2 & @CRLF) $mox.FireMidiInput = 1 ; begins input $mox.DivertMidiInput = 1 ; when set, routes all data MsgBox (0,"Midi-OX","Press OK to end MIDI Loop") ; sits in a message loop ; ----------------------------------------------------------- ;This is the function that gets called by MIDI-OX Func OnTrigger_MidiInput( $timestamp, $status, $chan, $dat1, $dat2) ; ship it right back $mox.OutputMidiMsg ($status + $chan, $dat1, $dat2) EndFunc ; ----------------------------------------------------------- ; The MIDI Input Devices Local $str = "Sys MIDI Input Devices: " & $mox.SysMidiInCount Local $strWrk = $mox.GetFirstSysMidiInDev while $strWrk <> "" $str = $str & @CRLF & " " & $strWrk $strWrk = $mox.GetNextSysMidiInDev Wend ConsoleWrite(@CRLF) ConsoleWrite($Str & @CRLF) ConsoleWrite(@CRLF) ; ----------------------------------------------------------- ; The MIDI Input Devices Local $str = "Sys MIDI Output Devices: " & $mox.SysMidiOutCount Local $strWrk = $mox.GetFirstSysMidiOutDev while $strWrk <> "" $str = $str & @CRLF & " " & $strWrk $strWrk = $mox.GetNextSysMidiOutDev Wend ConsoleWrite(@CRLF) ConsoleWrite($Str & @CRLF) ConsoleWrite(@CRLF) ; ----------------------------------------------------------- ; The MIDI Next Open Input Device Local $str = "Open MIDI Input Devices: " & $mox.OpenMidiInCount Local $strWrk = $mox.GetFirstOpenMidiInDev while $strWrk <> "" $id = $mox.GetInPortID( $strWrk ) $name = $mox.GetInPortName( $strWrk ) $str = $str & @CRLF & " " & $strWrk & " " & $id & " " & $name $strWrk = $mox.GetNextOpenMidiInDev Wend ConsoleWrite(@CRLF) ConsoleWrite($Str & @CRLF) ConsoleWrite(@CRLF) ; ----------------------------------------------------------- ; The MIDI Next Open Output Device Local $str = "Open MIDI Output Devices: " & $mox.OpenMidiOutCount Local $strWrk = $mox.GetFirstOpenMidiOutDev while $strWrk <> "" $id = $mox.GetOutPortID( $strWrk ) $name = $mox.GetOutPortName( $strWrk ) $str = $str & @CRLF & " " & $strWrk & " " & $id & " " & $name $strWrk = $mox.GetNextOpenMidiOutDev Wend ConsoleWrite(@CRLF) ConsoleWrite($Str & @CRLF) ConsoleWrite(@CRLF) MsgBox (0,"Midi-OX","Press OK to end MIDI-OX version : " ) If MsgBox($MB_OKCANCEL, "Shutdown?", "OK to exit MIDI-OX version " & $mox.GetAppVersion ) = 1 Then $mox.ShutdownAtEnd = 1 $mox.FireMidiInput = 0 ; stops MIDI input $mox.DivertMidiInput = 0 Else $mox.ShutdownAtEnd = 0 EndIf Func MyErrFunc() $HexNumber=hex($oMyError.number,8) Msgbox(0,"AutoItCOM Test","We intercepted a COM Error !" & @CRLF & @CRLF & _ "err.description is: " & @TAB & $oMyError.description & @CRLF & _ "err.windescription:" & @TAB & $oMyError.windescription & @CRLF & _ "err.number is: " & @TAB & $HexNumber & @CRLF & _ "err.lastdllerror is: " & @TAB & $oMyError.lastdllerror & @CRLF & _ "err.scriptline is: " & @TAB & $oMyError.scriptline & @CRLF & _ "err.source is: " & @TAB & $oMyError.source & @CRLF & _ "err.helpfile is: " & @TAB & $oMyError.helpfile & @CRLF & _ "err.helpcontext is: " & @TAB & $oMyError.helpcontext _ ) SetError(1) ; to check for after this function returns Endfunc Testing Even if you do not have any hardware at your disposal, you can use this LoopBack MIDI driver. This software can be used to create virtual loopback MIDI-ports to interconnect applications on Windows, that want to open hardware-MIDI-ports for communication. Download here : https://www.tobias-erichsen.de/software/loopmidi.html MIDI Protocol Documentation (video) A must see short video series in order to understand the basics of the MIDI protocol Especially Part 1 / 2 / 4 / 5 / 7 are most valuable to get a good understanding. MIDI Part 1 - MIDI Signal Path - YouTube MIDI Part 2 - MIDI Message Types - YouTube MIDI Part 3 - DIN MIDI - YouTube MIDI Part 4 - MIDI Protocol Details - YouTube MIDI Part 5 - Channel Messages - YouTube MIDI Part 6 - MIDI Clock - YouTube MIDI Part 7 - SYSEX, etc. - YouTube Enjoy !
    1 point
  5. Maps are only supported in the latest AutoIt release.
    1 point
  6. Hi Together, @BigDaddyO I only call this UDF, which then copies the Code, an Create a seperate Window, in which you can controll the Programm (Step-by-Step, Run-to-Cursor, ...) I think (I'm not sure) I use this one: @SOLVE-SMART thank you, I wrote a little script, which you can control by the parameter: #AutoIt3Wrapper_Run_After=start "" "<Path to the exe>" [MSG] [Path:%in%] [Comment:"<StringToCommet>"] [Uncomment:"<StringToUncmmet>"] [Add:<LineToAdd>:"<StringToAdd>"] [Remove:<LineToRemove>:"<StringToRemove>"] [MSG]: Musst be the first parameter, opens an Messagebox at the start and the end of the Programm. [Path:%in%]: gives the Programm Path to the skript. [Comment:"<StringToCommet>"] : Search all occorrence of the String an adds ";### " at the start of the line. ==>Example: [Comment:"#include <_Dbug.au3>"] [Uncomment:"<StringToUncommet>"] : Search all occorrence of the String an removes ";### " from the start of the line if there is one. ==> Example: [Uncomment:"#include <_Dbug.au3>"] [Add:<LineToAdd>:"<StringToAdd>"]: Adds the <StringToAdd> to the Line <LineToAdd> if it is empty, if it isn't empty a line will be inserted above. ==> Example: [Add:10:"#include <_Dbug.au3>"] [Remove:<LineToRemove>:"<StringToRemove>"]: 1.Removes alle occurece <StringToRemove> from the Line <LineToRemove> ==> Example: [Add:10:"#include <_Dbug.au3>"] 2. If <LinetoRemove> isn't given, then the whole Script will searched an all occurence of <StringToRemove> will be removed ==> Example: [Add::"#include <_Dbug.au3>"] 3. If <StringToRemove> isn't given, then the whole Line <LineToRemove> will be deeleted ==> Example: [Add:10:] #Region ;**** Directives created by AutoIt3Wrapper_GUI **** #AutoIt3Wrapper_Res_Fileversion=1.0.1.3 #AutoIt3Wrapper_Res_Fileversion_AutoIncrement=y #AutoIt3Wrapper_Res_SaveSource=y #EndRegion ;**** Directives created by AutoIt3Wrapper_GUI **** #include <Array.au3> Local $MSG = False If $CmdLine[1] = "MSG" Then MsgBox(0, "Info", "Start") $MSG = True _ArrayDelete($CmdLine, 1) Endif ;Emergency stop HotKeySet("{ESC}", "Exit_Programm") Func Exit_Programm() Exit EndFunc ;Header Variables Local $sPathToAu3 = "" Local $aStringsToComment[0] Local $aStringsToUncomment[0] Local $aStringsToAdd[0][2] Local $aStringsToRemove[0][2] ;Cut Header For $i = 1 To Ubound($CmdLine) - 1 Select Case StringInStr($CmdLine[$i], "Path:") $sPathToAu3 = StringTrimLeft($CmdLine[$i], 5) Case StringInStr($CmdLine[$i], "Uncomment:") _ArrayAdd($aStringsToUncomment, StringTrimLeft($CmdLine[$i], 10)) Case StringInStr($CmdLine[$i], "Comment:") _ArrayAdd($aStringsToComment, StringTrimLeft($CmdLine[$i], 8)) Case StringInStr($CmdLine[$i], "Add:") Local $iSeperator2 = StringInStr($CmdLine[$i], ":", 0, 2) Local $iLine = StringMid($CmdLine[$i], 5, $iSeperator2-5) Local $sString = StringMid($CmdLine[$i], $iSeperator2+1) _ArrayAdd($aStringsToAdd, $iLine & "|" & $sString) Case StringInStr($CmdLine[$i], "Remove:") Local $iSeperator2 = StringInStr($CmdLine[$i], ":", 0, 2) If $iSeperator2 = 0 Then Local $iLine = StringMid($CmdLine[$i], 8) _ArrayAdd($aStringsToRemove, $iLine) Else Local $iLine = StringMid($CmdLine[$i], 8, $iSeperator2-8) Local $sString = StringMid($CmdLine[$i], $iSeperator2+1) _ArrayAdd($aStringsToRemove, $iLine & "|" & $sString) EndIf Case Else EndSelect Next ;Check Input If Not FileExists($sPathToAu3) Then MsgBox($MB_ICONERROR, "Error", "File To '.au3' doesn't exists") Exit EndIf ;Read File Local $aText = FileReadToArray($sPathToAu3) ;Comment Strings For $i = 0 To Ubound($aText) - 1 For $x = 0 To Ubound($aStringsToComment) - 1 If Not(StringLeft($aText[$i], 15) = "#AutoIt3Wrapper") And StringInStr($aText[$i], $aStringsToComment[$x]) Then $aText[$i] = ";### " & $aText[$i] EndIf Next Next ;Uncomment Strings For $i = 0 To Ubound($aText) - 1 For $x = 0 To Ubound($aStringsToUncomment) - 1 If Not(StringLeft($aText[$i], 15) = "#AutoIt3Wrapper") And StringInStr($aText[$i], $aStringsToUncomment[$x]) Then If StringLeft($aText[$i], 5) = ";### " Then $aText[$i] = StringTrimLeft($aText[$i], 5) EndIf Next Next ;Add Strings For $i = 0 To Ubound($aStringsToAdd) - 1 If $aText[$aStringsToAdd[$i][0]-1] = "" Then $aText[$aStringsToAdd[$i][0]-1] = $aStringsToAdd[$i][1] Else _ArrayInsert($aText, $aStringsToAdd[$i][0]-1, $aStringsToAdd[$i][1]) EndIf Next ;StringRemove For $i = 0 To Ubound($aStringsToRemove) - 1 Select Case $aStringsToRemove[$i][1] = "" ;delete whole line _ArrayDelete($aText, $aStringsToRemove[$i][0]-1) Case $aStringsToRemove[$i][0] = "" ;Delete every occurrence of the String in the whole text For $x = 0 To Ubound($aText) - 1 If StringInStr($aText[$x], "#AutoIt3Wrapper") Then ContinueLoop $aText[$x] = StringReplace($aText[$x], $aStringsToRemove[$i][1], "") Next Case Else ;Delete every occurrence of the String in the specific Line $aText[$aStringsToRemove[$i][0]-1] = StringReplace($aText[$aStringsToRemove[$i][0]-1], $aStringsToRemove[$i][1], "") EndSelect Next ;Write File Local $iFilehandle = FileOpen($sPathToAu3, 2) FileWrite($iFilehandle, _ArrayToString($aText, @CRLF)) FileClose($iFilehandle) If $MSG Then MsgBox(0, "Info", "End") of course you can use it in #AutoIt3Wrapper_Run_After= as well.
    1 point
  7. ptrex

    COM Midi-OX Scripting

    Added a Youtubube video series in the first post regarding the MIDI Protocol explained, created by Andrew Kilpatrick A must see !! for anyone who get's there feet wet in MIDI scripting... Enjoy !
    1 point
  8. @senatin the syntax you used in your last post isn't correct because it creates a Map variable, not an Array variable : Local $test[] If you had checked @error just after _ArrayAdd, or if you had tried to display the "Array" with _ArrayDisplay (it won't have displayed anything), then you would have noticed something was going wrong. Based on your last post, here are 2 tests that say Else : #include <Array.au3> ; Local $test[] ; AutoIt 3.3.14.5 : fatal error ("Variable subscript badly formatted") ; ; AutoIt 3.3.16.1 : VarGetType($test) will be a Map, not an Array Local $test[0] ; AutoIt 3.3.14.5 and AutoIt 3.3.16.1 are ok ; VarGetType($test) will be an Array in both environments. ; _ArrayAdd($test, 1) ; why add 1 when it should be 2 ? _ArrayAdd($test, 2) _ArrayAdd($test, 1) _ArrayDisplay($test, "1st test") Switch 2 Case $test[0] To $test[1] ConsoleWrite(@CR&"WALK"&@CR) Case Else ConsoleWrite(@CR&"ELSE"&@CR) EndSwitch #include <Array.au3> Local $test[2] $test[0] = 2 $test[1] = 1 _ArrayDisplay($test, "2nd test") Switch 2 Case $test[0] To $test[1] ConsoleWrite(@CR&"WALK"&@CR) Case Else ConsoleWrite(@CR&"ELSE"&@CR) EndSwitch Now, concerning the script found in your 1st post : Local $test[2] = [2, 0] Switch 2 ; Case $test[0] To $test[Ubound($test)-1] ; e.g. 2 To 0 Case 2 To 0 ; not effectued at all, because descending ConsoleWrite(@CR&"WALK"&@CR) Case Else ; <=== THIS WILL BE THE RESULT ConsoleWrite(@CR&"ELSE"&@CR) EndSwitch It seems that "Case 2 To 0" never matches a "Switch 2" because the values found in the Case are descending. The following script just indicates what happens comparatively in a For...Next loop, when the values are descending (especially the resulting $i = 2 in 2nd example and not -10 : even if the loop isn't processed, the value of $i becomes 2) $i = - 10 For $i = 0 To 2 Next ConsoleWrite("$i = " & $i & @crlf) ; 3 $i = - 10 For $i = 2 To 0 ; wrong syntax, just to show $i = 2 after the loop, and not -10 Next ConsoleWrite("$i = " & $i & @crlf) ; 2 $i = - 10 For $i = 2 To 0 Step - 1 ; correct syntax Next ConsoleWrite("$i = " & $i & @crlf) ; - 1
    1 point
  9. Hi @Arun-Emmanuel, change this line: Local $aArray [0]= _Excel_RangeRead($oExcel, Default) to this: Local $aArray = _Excel_RangeRead($oExcel, Default) and try again 😀 . Best regards Sven
    1 point
  10. Hi @Floooooo24, you can call another program in the "before directive". So you could call a script/exe with your script full path as parameter. This script/exe would search and remove your #include <_Dbug.au3> line, then this program is done and the compiling process proceeds without your specific line 😀 . This is at least one way that should fit your requirement 🤝 . Best regards Sven
    1 point
  11. ptrex

    Device Management API

    Here you go ... Enjoy ! Device API.zip
    1 point
  12. I forgot about this, but the solution was to turn off "Enable Protected Mode" in the IE Security tab.
    1 point
  13. Well, as it turns out... for me this was an IE setting. "This is a low-risk reduction in web and mail security." Control Panel, open Internet Options. On the Advanced tab, deselect Check for server certificate revocation Understanding Certificate Revocation Checks https://blogs.msdn.microsoft.com/ieinternals/2011/04/07/understanding-certificate-revocation-checks/ I wouldn't expect anyone else to have to do that but that was my solution - SADLY...
    1 point
  14. cres

    [SOLVED] InetGet error 13!

    Hi, Try adding HttpSetUserAgent HttpSetUserAgent("Mozilla/5.0 (Windows NT 6.3; rv:36.0) Gecko/20100101 Firefox/36.0") Local $iInetRet = InetGet("https://www.autoitscript.com/autoit3/pkgmgr/sqlite/SQLite.dll.au3", @TempDir & "\SQLite.dll.au3", 9) ConsoleWrite("!Error: " & @error & @CRLF) I also got error code 13 without it.
    1 point
  15. PeteW

    iNetGet Fails

    Hello, I found this post whilst trying to find what the various iNetGet @error and @extended codes mean. See the end for a simple look-up function that returns a text description based on iNetGet()'s @extended code. NB I found that an incorrect username or password both return (@error 21 and) @extended 12014; according to Microsoft (see link below), an incorrect username should return 12013. Tip: when testing iNetGet(), ensure the source / download file is not empty (0-byte). iNetGet returns a non-0 @error code (and @extended=0) when downloading an empty file. During testing, I've seen: @error=13 when the d/l fails (e.g. bad username / passwd) @error=33 when the d/l succeeds - in addition, the 'success?' test, InetGetInfo(handle, 3), returns 'False' if the host file is 0 bytes, even though it has downloaded. Cheers, Pete. Func _InetGetErrorText($iErrorCode, $iInfoLevel = 1) ; PeteW, last updated: 16.01.12 ; $iErrorCode = @extended [InetGetInfo(handle,5)] code number ; $iInfoLevel 1 (Default) = return 'ERROR_CODE' text only, 2 = return 'Description' text only, 3 = return 'ERROR_CODE: Description' text. ; Codes / descriptions obtained from http://support.microsoft.com/kb/193625 & http://www.mathemainzel.info/files/w32ineterrors.html ; Local $sErrMsg, $sErrDesc Switch $iErrorCode Case 0 If BitAND($iInfoLevel, 1) Then $sErrMsg = "ERROR_SUCCESS" If BitAND($iInfoLevel, 2) Then $sErrDesc = "Action completed successfully." Case 12001 If BitAND($iInfoLevel, 1) Then $sErrMsg = "ERROR_INTERNET_OUT_OF_HANDLES" If BitAND($iInfoLevel, 2) Then $sErrDesc = "No more handles could be generated at this time." Case 12002 If BitAND($iInfoLevel, 1) Then $sErrMsg = "ERROR_INTERNET_TIMEOUT" If BitAND($iInfoLevel, 2) Then $sErrDesc = "The request has timed out." Case 12003 If BitAND($iInfoLevel, 1) Then $sErrMsg = "INTERNET_EXTENDED_ERROR" If BitAND($iInfoLevel, 2) Then $sErrDesc = "An extended error was returned from the server [may be 'file not found']. This is typically a string or buffer containing a verbose error message. Call InternetGetLastResponseInfo to retrieve the error text." Case 12004 If BitAND($iInfoLevel, 1) Then $sErrMsg = "INTERNET_INTERNAL_ERROR" If BitAND($iInfoLevel, 2) Then $sErrDesc = "An internal error has occurred." Case 12005 If BitAND($iInfoLevel, 1) Then $sErrMsg = "INTERNET_INVALID_URL" If BitAND($iInfoLevel, 2) Then $sErrDesc = "The URL is invalid." Case 12006 If BitAND($iInfoLevel, 1) Then $sErrMsg = "INTERNET_UNRECOGNIZED_SCHEME" If BitAND($iInfoLevel, 2) Then $sErrDesc = "The URL scheme could not be recognized or is not supported." Case 12007 If BitAND($iInfoLevel, 1) Then $sErrMsg = "INTERNET_NAME_NOT_RESOLVED" If BitAND($iInfoLevel, 2) Then $sErrDesc = "The server name could not be resolved." Case 12008 If BitAND($iInfoLevel, 1) Then $sErrMsg = "INTERNET_PROTOCOL_NOT_FOUND" If BitAND($iInfoLevel, 2) Then $sErrDesc = "The requested protocol could not be located." Case 12009 If BitAND($iInfoLevel, 1) Then $sErrMsg = "INTERNET_INVALID_OPTION" If BitAND($iInfoLevel, 2) Then $sErrDesc = "A request to InternetQueryOption or InternetSetOption specified an invalid option value." Case 12010 If BitAND($iInfoLevel, 1) Then $sErrMsg = "INTERNET_BAD_OPTION_LENGTH" If BitAND($iInfoLevel, 2) Then $sErrDesc = "The length of an option supplied to InternetQueryOption or InternetSetOption is incorrect for the type of option specified." Case 12011 If BitAND($iInfoLevel, 1) Then $sErrMsg = "INTERNET_OPTION_NOT_SETTABLE" If BitAND($iInfoLevel, 2) Then $sErrDesc = "The request option cannot be set, only queried." Case 12012 If BitAND($iInfoLevel, 1) Then $sErrMsg = "INTERNET_SHUTDOWN" If BitAND($iInfoLevel, 2) Then $sErrDesc = "The Win32 Internet function support is being shut down or unloaded." Case 12013 If BitAND($iInfoLevel, 1) Then $sErrMsg = "INTERNET_INCORRECT_USER_NAME" If BitAND($iInfoLevel, 2) Then $sErrDesc = "The request to connect and log on to an FTP server could not be completed because the supplied user name is incorrect." Case 12014 If BitAND($iInfoLevel, 1) Then $sErrMsg = "INTERNET_INCORRECT_PASSWORD" If BitAND($iInfoLevel, 2) Then $sErrDesc = "The request to connect and log on to an FTP server could not be completed because the supplied password is incorrect." Case 12015 If BitAND($iInfoLevel, 1) Then $sErrMsg = "INTERNET_LOGIN_FAILURE" If BitAND($iInfoLevel, 2) Then $sErrDesc = "The request to connect to and log on to an FTP server failed." Case 12016 If BitAND($iInfoLevel, 1) Then $sErrMsg = "INTERNET_INVALID_OPERATION" If BitAND($iInfoLevel, 2) Then $sErrDesc = "The requested operation is invalid." Case 12017 If BitAND($iInfoLevel, 1) Then $sErrMsg = "INTERNET_OPERATION_CANCELLED" If BitAND($iInfoLevel, 2) Then $sErrDesc = "The operation was canceled, usually because the handle on which the request was operating was closed before the operation completed." Case 12018 If BitAND($iInfoLevel, 1) Then $sErrMsg = "INTERNET_INCORRECT_HANDLE_TYPE" If BitAND($iInfoLevel, 2) Then $sErrDesc = "The type of handle supplied is incorrect for this operation." Case 12019 If BitAND($iInfoLevel, 1) Then $sErrMsg = "INTERNET_INCORRECT_HANDLE_STATE" If BitAND($iInfoLevel, 2) Then $sErrDesc = "The requested operation cannot be carried out because the handle supplied is not in the correct state." Case 12020 If BitAND($iInfoLevel, 1) Then $sErrMsg = "INTERNET_NOT_PROXY_REQUEST" If BitAND($iInfoLevel, 2) Then $sErrDesc = "The request cannot be made via a proxy." Case 12021 If BitAND($iInfoLevel, 1) Then $sErrMsg = "INTERNET_REGISTRY_VALUE_NOT_FOUND" If BitAND($iInfoLevel, 2) Then $sErrDesc = "A required registry value could not be located." Case 12022 If BitAND($iInfoLevel, 1) Then $sErrMsg = "INTERNET_BAD_REGISTRY_PARAMETER" If BitAND($iInfoLevel, 2) Then $sErrDesc = "A required registry value was located but is an incorrect type or has an invalid value." Case 12023 If BitAND($iInfoLevel, 1) Then $sErrMsg = "INTERNET_NO_DIRECT_ACCESS" If BitAND($iInfoLevel, 2) Then $sErrDesc = "Direct network access cannot be made at this time." Case 12024 If BitAND($iInfoLevel, 1) Then $sErrMsg = "INTERNET_NO_CONTEXT" If BitAND($iInfoLevel, 2) Then $sErrDesc = "An asynchronous request could not be made because a zero context value was supplied." Case 12025 If BitAND($iInfoLevel, 1) Then $sErrMsg = "INTERNET_NO_CALLBACK" If BitAND($iInfoLevel, 2) Then $sErrDesc = "An asynchronous request could not be made because a callback function has not been set." Case 12026 If BitAND($iInfoLevel, 1) Then $sErrMsg = "INTERNET_REQUEST_PENDING" If BitAND($iInfoLevel, 2) Then $sErrDesc = "The required operation could not be completed because one or more requests are pending." Case 12027 If BitAND($iInfoLevel, 1) Then $sErrMsg = "INTERNET_INCORRECT_FORMAT" If BitAND($iInfoLevel, 2) Then $sErrDesc = "The format of the request is invalid." Case 12028 If BitAND($iInfoLevel, 1) Then $sErrMsg = "INTERNET_ITEM_NOT_FOUND" If BitAND($iInfoLevel, 2) Then $sErrDesc = "The requested item could not be located." Case 12029 If BitAND($iInfoLevel, 1) Then $sErrMsg = "INTERNET_CANNOT_CONNECT" If BitAND($iInfoLevel, 2) Then $sErrDesc = "The attempt to connect to the server failed." Case 12030 If BitAND($iInfoLevel, 1) Then $sErrMsg = "INTERNET_CONNECTION_ABORTED" If BitAND($iInfoLevel, 2) Then $sErrDesc = "The connection with the server has been terminated." Case 12031 If BitAND($iInfoLevel, 1) Then $sErrMsg = "INTERNET_CONNECTION_RESET" If BitAND($iInfoLevel, 2) Then $sErrDesc = "The connection with the server has been reset." Case 12032 If BitAND($iInfoLevel, 1) Then $sErrMsg = "INTERNET_FORCE_RETRY" If BitAND($iInfoLevel, 2) Then $sErrDesc = "Calls for the Win32 Internet function to redo the request." Case 12033 If BitAND($iInfoLevel, 1) Then $sErrMsg = "INTERNET_INVALID_PROXY_REQUEST" If BitAND($iInfoLevel, 2) Then $sErrDesc = "The request to the proxy was invalid." Case 12034 If BitAND($iInfoLevel, 1) Then $sErrMsg = "ERROR_INTERNET_NEED_UI" If BitAND($iInfoLevel, 2) Then $sErrDesc = "A user interface or other blocking operation has been requested." Case 12036 If BitAND($iInfoLevel, 1) Then $sErrMsg = "INTERNET_HANDLE_EXISTS" If BitAND($iInfoLevel, 2) Then $sErrDesc = "The request failed because the handle already exists." Case 12037 If BitAND($iInfoLevel, 1) Then $sErrMsg = "INTERNET_SEC_CERT_DATE_INVALID" If BitAND($iInfoLevel, 2) Then $sErrDesc = "SSL certificate date that was received from the server is bad. The certificate is expired." Case 12038 If BitAND($iInfoLevel, 1) Then $sErrMsg = "INTERNET_SEC_CERT_CN_INVALID" If BitAND($iInfoLevel, 2) Then $sErrDesc = "SSL certificate common name (host name field) is incorrect. For example, if you entered www.server.com and the common name on the certificate says www.different.com." Case 12039 If BitAND($iInfoLevel, 1) Then $sErrMsg = "INTERNET_HTTP_TO_HTTPS_ON_REDIR" If BitAND($iInfoLevel, 2) Then $sErrDesc = "The application is moving from a non-SSL to an SSL connection because of a redirect." Case 12040 If BitAND($iInfoLevel, 1) Then $sErrMsg = "INTERNET_HTTPS_TO_HTTP_ON_REDIR" If BitAND($iInfoLevel, 2) Then $sErrDesc = "The application is moving from an SSL to an non-SSL connection because of a redirect." Case 12041 If BitAND($iInfoLevel, 1) Then $sErrMsg = "INTERNET_MIXED_SECURITY" If BitAND($iInfoLevel, 2) Then $sErrDesc = "Indicates that the content is not entirely secure. Some of the content being viewed may have come from unsecured servers." Case 12042 If BitAND($iInfoLevel, 1) Then $sErrMsg = "INTERNET_CHG_POST_IS_NON_SECURE" If BitAND($iInfoLevel, 2) Then $sErrDesc = "The application is posting and attempting to change multiple lines of text on a server that is not secure." Case 12043 If BitAND($iInfoLevel, 1) Then $sErrMsg = "INTERNET_POST_IS_NON_SECURE" If BitAND($iInfoLevel, 2) Then $sErrDesc = "The application is posting data to a server that is not secure." Case 12044 If BitAND($iInfoLevel, 1) Then $sErrMsg = "ERROR_INTERNET_CLIENT_AUTH_CERT_NEEDED" If BitAND($iInfoLevel, 2) Then $sErrDesc = "The server is requesting client authentication." Case 12045 If BitAND($iInfoLevel, 1) Then $sErrMsg = "ERROR_INTERNET_INVALID_CA" If BitAND($iInfoLevel, 2) Then $sErrDesc = "The function is unfamiliar with the Certificate Authority that generated the server's certificate." Case 12046 If BitAND($iInfoLevel, 1) Then $sErrMsg = "ERROR_INTERNET_CLIENT_AUTH_NOT_SETUP" If BitAND($iInfoLevel, 2) Then $sErrDesc = "Client authorization is not set up on this computer." Case 12047 If BitAND($iInfoLevel, 1) Then $sErrMsg = "ERROR_INTERNET_ASYNC_THREAD_FAILED" If BitAND($iInfoLevel, 2) Then $sErrDesc = "The application could not start an asynchronous thread." Case 12048 If BitAND($iInfoLevel, 1) Then $sErrMsg = "ERROR_INTERNET_REDIRECT_SCHEME_CHANGE" If BitAND($iInfoLevel, 2) Then $sErrDesc = "The function could not handle the redirection, because the scheme changed (for example, HTTP to FTP)." Case 12049 If BitAND($iInfoLevel, 1) Then $sErrMsg = "ERROR_INTERNET_DIALOG_PENDING" If BitAND($iInfoLevel, 2) Then $sErrDesc = "Another thread has a password dialog box in progress." Case 12050 If BitAND($iInfoLevel, 1) Then $sErrMsg = "ERROR_INTERNET_RETRY_DIALOG" If BitAND($iInfoLevel, 2) Then $sErrDesc = "The dialog box should be retried." Case 12052 If BitAND($iInfoLevel, 1) Then $sErrMsg = "ERROR_INTERNET_HTTPS_HTTP_SUBMIT_REDIR" If BitAND($iInfoLevel, 2) Then $sErrDesc = "The data being submitted to an SSL connection is being redirected to a non-SSL connection." Case 12053 If BitAND($iInfoLevel, 1) Then $sErrMsg = "ERROR_INTERNET_INSERT_CDROM" If BitAND($iInfoLevel, 2) Then $sErrDesc = "The request requires a CD-ROM to be inserted in the CD-ROM drive to locate the resource requested." Case 12054 If BitAND($iInfoLevel, 1) Then $sErrMsg = "ERROR_INTERNET_FORTEZZA_LOGIN_NEEDED" If BitAND($iInfoLevel, 2) Then $sErrDesc = "The requested resource requires Fortezza authentication." Case 12055 If BitAND($iInfoLevel, 1) Then $sErrMsg = "ERROR_INTERNET_SEC_CERT_ERRORS" If BitAND($iInfoLevel, 2) Then $sErrDesc = "The SSL certificate contains errors." Case 12056 If BitAND($iInfoLevel, 1) Then $sErrMsg = "ERROR_INTERNET_SEC_CERT_NO_REV" If BitAND($iInfoLevel, 2) Then $sErrDesc = "The SSL certificate was not revoked." Case 12057 If BitAND($iInfoLevel, 1) Then $sErrMsg = "ERROR_INTERNET_SEC_CERT_REV_FAILED" If BitAND($iInfoLevel, 2) Then $sErrDesc = "Revocation of the SSL certificate failed." Case 12110 If BitAND($iInfoLevel, 1) Then $sErrMsg = "FTP_TRANSFER_IN_PROGRESS" If BitAND($iInfoLevel, 2) Then $sErrDesc = "The requested operation cannot be made on the FTP session handle because an operation is already in progress." Case 12111 If BitAND($iInfoLevel, 1) Then $sErrMsg = "FTP_DROPPED" If BitAND($iInfoLevel, 2) Then $sErrDesc = "The FTP operation was not completed because the session was aborted." Case 12130 If BitAND($iInfoLevel, 1) Then $sErrMsg = "GOPHER_PROTOCOL_ERROR" If BitAND($iInfoLevel, 2) Then $sErrDesc = "An error was detected while parsing data returned from the gopher server." Case 12131 If BitAND($iInfoLevel, 1) Then $sErrMsg = "GOPHER_NOT_FILE" If BitAND($iInfoLevel, 2) Then $sErrDesc = "The request must be made for a file locator." Case 12132 If BitAND($iInfoLevel, 1) Then $sErrMsg = "GOPHER_DATA_ERROR" If BitAND($iInfoLevel, 2) Then $sErrDesc = "An error was detected while receiving data from the gopher server." Case 12133 If BitAND($iInfoLevel, 1) Then $sErrMsg = "GOPHER_END_OF_DATA" If BitAND($iInfoLevel, 2) Then $sErrDesc = "The end of the data has been reached." Case 12134 If BitAND($iInfoLevel, 1) Then $sErrMsg = "GOPHER_INVALID_LOCATOR" If BitAND($iInfoLevel, 2) Then $sErrDesc = "The supplied locator is not valid." Case 12135 If BitAND($iInfoLevel, 1) Then $sErrMsg = "GOPHER_INCORRECT_LOCATOR_TYPE" If BitAND($iInfoLevel, 2) Then $sErrDesc = "The type of the locator is not correct for this operation." Case 12136 If BitAND($iInfoLevel, 1) Then $sErrMsg = "GOPHER_NOT_GOPHER_PLUS" If BitAND($iInfoLevel, 2) Then $sErrDesc = "The requested operation can only be made against a Gopher+ server or with a locator that specifies a Gopher+ operation." Case 12137 If BitAND($iInfoLevel, 1) Then $sErrMsg = "GOPHER_ATTRIBUTE_NOT_FOUND" If BitAND($iInfoLevel, 2) Then $sErrDesc = "The requested attribute could not be located." Case 12138 If BitAND($iInfoLevel, 1) Then $sErrMsg = "GOPHER_UNKNOWN_LOCATOR" If BitAND($iInfoLevel, 2) Then $sErrDesc = "The locator type is unknown." Case 12150 If BitAND($iInfoLevel, 1) Then $sErrMsg = "HTTP_HEADER_NOT_FOUND" If BitAND($iInfoLevel, 2) Then $sErrDesc = "The requested header could not be located." Case 12151 If BitAND($iInfoLevel, 1) Then $sErrMsg = "HTTP_DOWNLEVEL_SERVER" If BitAND($iInfoLevel, 2) Then $sErrDesc = "The server did not return any headers." Case 12152 If BitAND($iInfoLevel, 1) Then $sErrMsg = "HTTP_INVALID_SERVER_RESPONSE" If BitAND($iInfoLevel, 2) Then $sErrDesc = "The server response could not be parsed." Case 12153 If BitAND($iInfoLevel, 1) Then $sErrMsg = "HTTP_INVALID_HEADER" If BitAND($iInfoLevel, 2) Then $sErrDesc = "The supplied header is invalid." Case 12154 If BitAND($iInfoLevel, 1) Then $sErrMsg = "HTTP_INVALID_QUERY_REQUEST" If BitAND($iInfoLevel, 2) Then $sErrDesc = "The request made to HttpQueryInfo is invalid." Case 12155 If BitAND($iInfoLevel, 1) Then $sErrMsg = "HTTP_HEADER_ALREADY_EXISTS" If BitAND($iInfoLevel, 2) Then $sErrDesc = "The header could not be added because it already exists." Case 12156 If BitAND($iInfoLevel, 1) Then $sErrMsg = "HTTP_REDIRECT_FAILED" If BitAND($iInfoLevel, 2) Then $sErrDesc = "The redirection failed because either the scheme changed (for example, HTTP to FTP) or all attempts made to redirect failed (default is five attempts)." Case 12157 If BitAND($iInfoLevel, 1) Then $sErrMsg = "ERROR_INTERNET_SECURITY_CHANNEL_ERROR" If BitAND($iInfoLevel, 2) Then $sErrDesc = "The application experienced an internal error loading the SSL libraries." Case 12158 If BitAND($iInfoLevel, 1) Then $sErrMsg = "ERROR_INTERNET_UNABLE_TO_CACHE_FILE" If BitAND($iInfoLevel, 2) Then $sErrDesc = "The function was unable to cache the file." Case 12159 If BitAND($iInfoLevel, 1) Then $sErrMsg = "ERROR_INTERNET_TCPIP_NOT_INSTALLED" If BitAND($iInfoLevel, 2) Then $sErrDesc = "The required protocol stack is not loaded and the application cannot start WinSock." Case 12160 If BitAND($iInfoLevel, 1) Then $sErrMsg = "ERROR_HTTP_NOT_REDIRECTED" If BitAND($iInfoLevel, 2) Then $sErrDesc = "The HTTP request was not redirected." Case 12161 If BitAND($iInfoLevel, 1) Then $sErrMsg = "ERROR_HTTP_COOKIE_NEEDS_CONFIRMATION" If BitAND($iInfoLevel, 2) Then $sErrDesc = "The HTTP cookie requires confirmation." Case 12162 If BitAND($iInfoLevel, 1) Then $sErrMsg = "ERROR_HTTP_COOKIE_DECLINED" If BitAND($iInfoLevel, 2) Then $sErrDesc = "The HTTP cookie was declined by the server." Case 12163 If BitAND($iInfoLevel, 1) Then $sErrMsg = "ERROR_INTERNET_DISCONNECTED" If BitAND($iInfoLevel, 2) Then $sErrDesc = "The Internet connection has been lost." Case 12164 If BitAND($iInfoLevel, 1) Then $sErrMsg = "ERROR_INTERNET_SERVER_UNREACHABLE" If BitAND($iInfoLevel, 2) Then $sErrDesc = "The Web site or server indicated is unreachable." Case 12165 If BitAND($iInfoLevel, 1) Then $sErrMsg = "ERROR_INTERNET_PROXY_SERVER_UNREACHABLE" If BitAND($iInfoLevel, 2) Then $sErrDesc = "The designated proxy server cannot be reached." Case 12166 If BitAND($iInfoLevel, 1) Then $sErrMsg = "ERROR_INTERNET_BAD_AUTO_PROXY_SCRIPT" If BitAND($iInfoLevel, 2) Then $sErrDesc = "There was an error in the automatic proxy configuration script." Case 12167 If BitAND($iInfoLevel, 1) Then $sErrMsg = "ERROR_INTERNET_UNABLE_TO_DOWNLOAD_SCRIPT" If BitAND($iInfoLevel, 2) Then $sErrDesc = "The automatic proxy configuration script could not be downloaded. The INTERNET_FLAG_MUST_CACHE_REQUEST flag was set." Case 12168 If BitAND($iInfoLevel, 1) Then $sErrMsg = "ERROR_HTTP_REDIRECT_NEEDS_CONFIRMATION" If BitAND($iInfoLevel, 2) Then $sErrDesc = "The redirection requires user confirmation." Case 12169 If BitAND($iInfoLevel, 1) Then $sErrMsg = "ERROR_INTERNET_SEC_INVALID_CERT" If BitAND($iInfoLevel, 2) Then $sErrDesc = "SSL certificate is invalid." Case 12170 If BitAND($iInfoLevel, 1) Then $sErrMsg = "ERROR_INTERNET_SEC_CERT_REVOKED" If BitAND($iInfoLevel, 2) Then $sErrDesc = "SSL certificate was revoked." Case 12171 If BitAND($iInfoLevel, 1) Then $sErrMsg = "ERROR_INTERNET_FAILED_DUETOSECURITYCHECK" If BitAND($iInfoLevel, 2) Then $sErrDesc = "The function failed due to a security check." Case 12172 If BitAND($iInfoLevel, 1) Then $sErrMsg = "ERROR_INTERNET_NOT_INITIALIZED" If BitAND($iInfoLevel, 2) Then $sErrDesc = "Initialization of the WinINet API has not occurred. Indicates that a higher-level function, such as InternetOpen, has not been called yet." Case 12174 If BitAND($iInfoLevel, 1) Then $sErrMsg = "ERROR_INTERNET_LOGIN_FAILURE_DISPLAY_ENTITY_BODY" If BitAND($iInfoLevel, 2) Then $sErrDesc = "The MS-Logoff digest header has been returned from the Web site. This header specifically instructs the digest package to purge credentials for the associated realm. This error will only be returned if INTERNET_ERROR_MASK_LOGIN_FAILURE_DISPLAY_ENTITY_BODY has been set." Case Else If BitAND($iInfoLevel, 1) Then $sErrMsg = "ERROR_UNKNOWN" If BitAND($iInfoLevel, 2) Then $sErrDesc = "Unidentified error - no description available." EndSwitch If $sErrMsg And $sErrDesc Then $sErrMsg &= ": " Return $sErrMsg & $sErrDesc EndFunc ;==>_InetGetErrorText
    1 point
  16. SOLVED: I had some stupid virus and it set a proxy to Internet Explorer. Opera, my regular browser, was working fine, so I did not checked IE. Removed proxy settings, program is again working perfectly !!!! And Windows XP is on vmware, for testing, probably already virused. Windows 7, main machine, is working perfectly !
    1 point
  17. Andreik

    InetRead error codes

    I get same error with InetGet. EDIT: got it work in this way Local $oHTTP = ObjCreate("winhttp.winhttprequest.5.1") $oHTTP.Open("GET","http://" & $sDomain & ":2086/xml-api/loadavg",False) $oHTTP.SetRequestHeader("User-Agent","Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.9.0.5) Gecko/2008120122 Firefox/3.0.5") $oHTTP.SetCredentials($sUser,$sPass,0) $oHTTP.Send("") $sXML = $oHTTP.ResponseText()
    1 point
×
×
  • Create New...