mnkt Posted February 26, 2021 Share Posted February 26, 2021 Hi Everyone, I try to use UDF Serial from @mLipok Link to comment Share on other sites More sharing options...
mnkt Posted February 26, 2021 Author Share Posted February 26, 2021 Hi Everyone, I try to use UDF Serial from @mLipok and @Danyfirex to get serial device name in Device Manager, but I don't know how to use or display it. My code #include <ComUDF.au3> #include <Array.au3> Local $ports = _COM_ListPorts() ;an array with com ports Local $portdevices = _COM_ListPortDevices() ;2DArray DevicesName|COMPort _ArrayDisplay($ports, "2D display transposed") _ArrayDisplay($portdevices, "2D display transposed") It only display $ports Array, nothing from $portdevices. I want to show prolific ..... COM port name like in the picture. Please could someone help me. Link to comment Share on other sites More sharing options...
Moderators JLogan3o13 Posted February 26, 2021 Moderators Share Posted February 26, 2021 Please stick to one topic. "Profanity is the last vestige of the feeble mind. For the man who cannot express himself forcibly through intellect must do so through shock and awe" - Spencer W. Kimball How to get your question answered on this forum! Link to comment Share on other sites More sharing options...
mnkt Posted February 26, 2021 Author Share Posted February 26, 2021 Omg I’m sorry, I don’t know why it make 2 post. How can I combine theme? Link to comment Share on other sites More sharing options...
Danyfirex Posted February 26, 2021 Share Posted February 26, 2021 Hello @mnkt Are you sure the port is not in use? Could you do a Reg Search inside this Registry Key? and check if you find your prolific device. HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Enum\USB Saludos Danysys.com AutoIt... UDFs: VirusTotal API 2.0 UDF - libZPlay UDF - Apps: Guitar Tab Tester - VirusTotal Hash Checker Examples: Text-to-Speech ISpVoice Interface - Get installed applications - Enable/Disable Network connection PrintHookProc - WINTRUST - Mute Microphone Level - Get Connected NetWorks - Create NetWork Connection ShortCut Link to comment Share on other sites More sharing options...
mnkt Posted February 27, 2021 Author Share Posted February 27, 2021 Hi @Danyfirex Nothing from registry key. How could I get the name like the one in Device Manager? Link to comment Share on other sites More sharing options...
Danyfirex Posted February 27, 2021 Share Posted February 27, 2021 @mnkt I meant you need to do a search inside all those keys, or try to do a global search to check where are those devices names. It's possible to get same those names using native device management API but in the background it use registry anyway so I would like to update the COMUDF to read from registry as It does currently. Saludos Danysys.com AutoIt... UDFs: VirusTotal API 2.0 UDF - libZPlay UDF - Apps: Guitar Tab Tester - VirusTotal Hash Checker Examples: Text-to-Speech ISpVoice Interface - Get installed applications - Enable/Disable Network connection PrintHookProc - WINTRUST - Mute Microphone Level - Get Connected NetWorks - Create NetWork Connection ShortCut Link to comment Share on other sites More sharing options...
Nine Posted February 27, 2021 Share Posted February 27, 2021 WMI may give you what you are looking for : Win32_SerialPort or more generically Win32_PnPEntity “They did not know it was impossible, so they did it” ― Mark Twain Spoiler Block all input without UAC Save/Retrieve Images to/from Text Monitor Management (VCP commands) Tool to search in text (au3) files Date Range Picker Virtual Desktop Manager Sudoku Game 2020 Overlapped Named Pipe IPC HotString 2.0 - Hot keys with string x64 Bitwise Operations Multi-keyboards HotKeySet Recursive Array Display Fast and simple WCD IPC Multiple Folders Selector Printer Manager GIF Animation (cached) Screen Scraping Multi-Threading Made Easy Link to comment Share on other sites More sharing options...
mnkt Posted March 2, 2021 Author Share Posted March 2, 2021 Really sorry for my slow response. I found theme here "... Prolific ..." Link to comment Share on other sites More sharing options...
Danyfirex Posted March 2, 2021 Share Posted March 2, 2021 Could you run this script and paste the console output here. expandcollapse popup;~ #AutoIt3Wrapper_UseX64=y #include <ComUDF.au3> #include <Array.au3> Local $ports = _COM_ListPorts() ;an array with com ports Local $portdevices = _COM_ListPortDevices_() ;2DArray DevicesName|COMPort _ArrayDisplay($ports, "2D display transposed") _ArrayDisplay($portdevices, "2D display transposed") Func _COM_ListPortDevices_($bIsAvailable = False) Local $aCOMPorts = _COM_ListPorts() If Not IsArray($aCOMPorts) Then Return SetError(1, 0, 0) Local Const $sKeyUSB = "HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Enum\USB" Local $iIndex = 1 Local $iSubIndex = 1 Local $sSubKey = "" Local $sSubKeyChild = "" Local $sFriendlyName = "" Local $sDriver = "" Local $bFoundAll = False Local $sCOMPort = "" Local $hCOMPort = "" Local $aCOMDevices[256][3] Local $iIndexDevices = 0 While True $sSubKey = RegEnumKey($sKeyUSB, $iIndex) If @error Then ExitLoop $iIndex += 1 $sSubKey = $sKeyUSB & "\" & $sSubKey $iSubIndex = 1 ConsoleWrite(@CRLF & @CRLF & ">" & $sSubKey & @CRLF) While True $sSubKeyChild = RegEnumKey($sSubKey, $iSubIndex) If @error Then ExitLoop $iSubIndex += 1 ConsoleWrite(">>" & $sSubKey & "\" & $sSubKeyChild & @CRLF) $sFriendlyName = RegRead($sSubKey & "\" & $sSubKeyChild, "FriendlyName") $sDriver = RegRead($sSubKey & "\" & $sSubKeyChild, "Driver") ConsoleWrite(">>>FriendlyName: " & $sFriendlyName & @TAB & "Driver: " & $sDriver & @CRLF) If $sFriendlyName = "" Then ContinueLoop $sCOMPort = RegRead("HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\Class\" & $sDriver, "AttachedTo") If $sCOMPort = "" Then $sCOMPort = RegRead("HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\Class\" & $sDriver, "AssignedPortForQCDevice") ConsoleWrite(">>>>AttachedTo: " & $sCOMPort & @CRLF) If $sCOMPort = "" Then ContinueLoop ; not Attached ;check if exist in $aCOMPorts and remove it For $x = 0 To UBound($aCOMPorts) - 1 If $aCOMPorts[$x] = "" Then ContinueLoop If $aCOMPorts[$x] = $sCOMPort Then $aCOMDevices[$iIndexDevices][0] = $sFriendlyName $aCOMDevices[$iIndexDevices][1] = $sCOMPort $aCOMDevices[$iIndexDevices][2] = False If $bIsAvailable Then $hCOMPort = _COM_OpenPort($sCOMPort) $aCOMDevices[$iIndexDevices][2] = $hCOMPort <> -1 If $hCOMPort <> -1 Then _COM_ClosePort($hCOMPort) EndIf $iIndexDevices += 1 ExitLoop EndIf Next If UBound($aCOMPorts) = 0 Then $bFoundAll = True If $bFoundAll Then ExitLoop WEnd If $bFoundAll Then ExitLoop WEnd ReDim $aCOMDevices[$iIndexDevices][3] If $iIndexDevices Then Return SetError(0, $iIndexDevices, $aCOMDevices) Return SetError(2, 0, 0) EndFunc ;==>_COM_ListPortDevices_ Saludos Danysys.com AutoIt... UDFs: VirusTotal API 2.0 UDF - libZPlay UDF - Apps: Guitar Tab Tester - VirusTotal Hash Checker Examples: Text-to-Speech ISpVoice Interface - Get installed applications - Enable/Disable Network connection PrintHookProc - WINTRUST - Mute Microphone Level - Get Connected NetWorks - Create NetWork Connection ShortCut Link to comment Share on other sites More sharing options...
mnkt Posted March 9, 2021 Author Share Posted March 9, 2021 On 3/2/2021 at 7:43 PM, Danyfirex said: Could you run this script and paste the console output here. expandcollapse popup;~ #AutoIt3Wrapper_UseX64=y #include <ComUDF.au3> #include <Array.au3> Local $ports = _COM_ListPorts() ;an array with com ports Local $portdevices = _COM_ListPortDevices_() ;2DArray DevicesName|COMPort _ArrayDisplay($ports, "2D display transposed") _ArrayDisplay($portdevices, "2D display transposed") Func _COM_ListPortDevices_($bIsAvailable = False) Local $aCOMPorts = _COM_ListPorts() If Not IsArray($aCOMPorts) Then Return SetError(1, 0, 0) Local Const $sKeyUSB = "HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Enum\USB" Local $iIndex = 1 Local $iSubIndex = 1 Local $sSubKey = "" Local $sSubKeyChild = "" Local $sFriendlyName = "" Local $sDriver = "" Local $bFoundAll = False Local $sCOMPort = "" Local $hCOMPort = "" Local $aCOMDevices[256][3] Local $iIndexDevices = 0 While True $sSubKey = RegEnumKey($sKeyUSB, $iIndex) If @error Then ExitLoop $iIndex += 1 $sSubKey = $sKeyUSB & "\" & $sSubKey $iSubIndex = 1 ConsoleWrite(@CRLF & @CRLF & ">" & $sSubKey & @CRLF) While True $sSubKeyChild = RegEnumKey($sSubKey, $iSubIndex) If @error Then ExitLoop $iSubIndex += 1 ConsoleWrite(">>" & $sSubKey & "\" & $sSubKeyChild & @CRLF) $sFriendlyName = RegRead($sSubKey & "\" & $sSubKeyChild, "FriendlyName") $sDriver = RegRead($sSubKey & "\" & $sSubKeyChild, "Driver") ConsoleWrite(">>>FriendlyName: " & $sFriendlyName & @TAB & "Driver: " & $sDriver & @CRLF) If $sFriendlyName = "" Then ContinueLoop $sCOMPort = RegRead("HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\Class\" & $sDriver, "AttachedTo") If $sCOMPort = "" Then $sCOMPort = RegRead("HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\Class\" & $sDriver, "AssignedPortForQCDevice") ConsoleWrite(">>>>AttachedTo: " & $sCOMPort & @CRLF) If $sCOMPort = "" Then ContinueLoop ; not Attached ;check if exist in $aCOMPorts and remove it For $x = 0 To UBound($aCOMPorts) - 1 If $aCOMPorts[$x] = "" Then ContinueLoop If $aCOMPorts[$x] = $sCOMPort Then $aCOMDevices[$iIndexDevices][0] = $sFriendlyName $aCOMDevices[$iIndexDevices][1] = $sCOMPort $aCOMDevices[$iIndexDevices][2] = False If $bIsAvailable Then $hCOMPort = _COM_OpenPort($sCOMPort) $aCOMDevices[$iIndexDevices][2] = $hCOMPort <> -1 If $hCOMPort <> -1 Then _COM_ClosePort($hCOMPort) EndIf $iIndexDevices += 1 ExitLoop EndIf Next If UBound($aCOMPorts) = 0 Then $bFoundAll = True If $bFoundAll Then ExitLoop WEnd If $bFoundAll Then ExitLoop WEnd ReDim $aCOMDevices[$iIndexDevices][3] If $iIndexDevices Then Return SetError(0, $iIndexDevices, $aCOMDevices) Return SetError(2, 0, 0) EndFunc ;==>_COM_ListPortDevices_ Saludos Hi thanks for your reply, sorry for my late. This is the output from your code Link to comment Share on other sites More sharing options...
Danyfirex Posted March 9, 2021 Share Posted March 9, 2021 I said console output 🙄 Saludos Danysys.com AutoIt... UDFs: VirusTotal API 2.0 UDF - libZPlay UDF - Apps: Guitar Tab Tester - VirusTotal Hash Checker Examples: Text-to-Speech ISpVoice Interface - Get installed applications - Enable/Disable Network connection PrintHookProc - WINTRUST - Mute Microphone Level - Get Connected NetWorks - Create NetWork Connection ShortCut Link to comment Share on other sites More sharing options...
mnkt Posted March 11, 2021 Author Share Posted March 11, 2021 On 3/9/2021 at 6:35 PM, Danyfirex said: I said console output 🙄 Saludos I'm sorry, I don't know how to output console. Could you help me? Link to comment Share on other sites More sharing options...
Danyfirex Posted March 11, 2021 Share Posted March 11, 2021 Hello Saludos Danysys.com AutoIt... UDFs: VirusTotal API 2.0 UDF - libZPlay UDF - Apps: Guitar Tab Tester - VirusTotal Hash Checker Examples: Text-to-Speech ISpVoice Interface - Get installed applications - Enable/Disable Network connection PrintHookProc - WINTRUST - Mute Microphone Level - Get Connected NetWorks - Create NetWork Connection ShortCut Link to comment Share on other sites More sharing options...
mnkt Posted March 12, 2021 Author Share Posted March 12, 2021 14 hours ago, Danyfirex said: Hello Saludos expandcollapse popup>"C:\Program Files (x86)\AutoIt3\SciTE\..\AutoIt3.exe" "C:\Program Files (x86)\AutoIt3\SciTE\AutoIt3Wrapper\AutoIt3Wrapper.au3" /run /prod /ErrorStdOut /in "C:\Users\kazih\Desktop\testmod.au3" /UserParams +>15:45:23 Starting AutoIt3Wrapper (19.1127.1402.0} from:SciTE.exe (4.2.0.0) Keyboard:00000409 OS:WIN_10/ CPU:X64 OS:X64 Environment(Language:0409) CodePage:0 utf8.auto.check:4 +> SciTEDir => C:\Program Files (x86)\AutoIt3\SciTE UserDir => C:\Users\kazih\AppData\Local\AutoIt v3\SciTE\AutoIt3Wrapper SCITE_USERHOME => C:\Users\kazih\AppData\Local\AutoIt v3\SciTE >Running AU3Check (3.3.14.5) from:C:\Program Files (x86)\AutoIt3 input:C:\Users\kazih\Desktop\testmod.au3 +>15:45:23 AU3Check ended.rc:0 >Running:(3.3.14.5):C:\Program Files (x86)\AutoIt3\autoit3.exe "C:\Users\kazih\Desktop\testmod.au3" +>Setting Hotkeys...--> Press Ctrl+Alt+Break to Restart or Ctrl+BREAK to Stop. >HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Enum\USB\ROOT_HUB30 >>HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Enum\USB\ROOT_HUB30\4&6618f79&0&0 >>>FriendlyName: Driver: {36fc9e60-c465-11cf-8056-444553540000}\0001 >HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Enum\USB\VID_0000&PID_0002 >>HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Enum\USB\VID_0000&PID_0002\5&2b1d7621&0&6 >>>FriendlyName: Driver: {36fc9e60-c465-11cf-8056-444553540000}\0008 >HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Enum\USB\VID_046D&PID_C52B >>HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Enum\USB\VID_046D&PID_C52B\5&2b1d7621&0&1 >>>FriendlyName: Driver: {36fc9e60-c465-11cf-8056-444553540000}\0006 >HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Enum\USB\VID_046D&PID_C52B&MI_00 >>HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Enum\USB\VID_046D&PID_C52B&MI_00\6&2473d6b0&0&0000 >>>FriendlyName: Driver: {745a17a0-74d3-11d0-b6fe-00a0c90f57da}\0005 >HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Enum\USB\VID_046D&PID_C52B&MI_01 >>HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Enum\USB\VID_046D&PID_C52B&MI_01\6&2473d6b0&0&0001 >>>FriendlyName: Driver: {745a17a0-74d3-11d0-b6fe-00a0c90f57da}\0006 >HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Enum\USB\VID_046D&PID_C52B&MI_02 >>HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Enum\USB\VID_046D&PID_C52B&MI_02\6&2473d6b0&0&0002 >>>FriendlyName: Driver: {745a17a0-74d3-11d0-b6fe-00a0c90f57da}\0007 >HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Enum\USB\VID_058F&PID_9254 >>HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Enum\USB\VID_058F&PID_9254\5&2b1d7621&0&6 >>>FriendlyName: Driver: {36fc9e60-c465-11cf-8056-444553540000}\0002 >>HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Enum\USB\VID_058F&PID_9254\6&2d5dc42f&0&4 >>>FriendlyName: Driver: {36fc9e60-c465-11cf-8056-444553540000}\0005 >HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Enum\USB\VID_067B&PID_2303 >>HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Enum\USB\VID_067B&PID_2303\5&2b1d7621&0&1 >>>FriendlyName: Prolific USB-to-Serial Comm Port (COM5) Driver: {4d36e978-e325-11ce-bfc1-08002be10318}\0008 >>>>AttachedTo: >>HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Enum\USB\VID_067B&PID_2303\5&2b1d7621&0&6 >>>FriendlyName: Prolific USB-to-Serial Comm Port (COM6) Driver: {4d36e978-e325-11ce-bfc1-08002be10318}\0003 >>>>AttachedTo: >>HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Enum\USB\VID_067B&PID_2303\6&12e3460c&0&2 >>>FriendlyName: Prolific USB-to-Serial Comm Port (COM5) Driver: {4d36e978-e325-11ce-bfc1-08002be10318}\0014 >>>>AttachedTo: >>HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Enum\USB\VID_067B&PID_2303\6&12e3460c&0&3 >>>FriendlyName: Prolific USB-to-Serial Comm Port (COM6) Driver: {4d36e978-e325-11ce-bfc1-08002be10318}\0015 >>>>AttachedTo: >>HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Enum\USB\VID_067B&PID_2303\6&12e3460c&0&4 >>>FriendlyName: Prolific USB-to-Serial Comm Port (COM4) Driver: {4d36e978-e325-11ce-bfc1-08002be10318}\0013 >>>>AttachedTo: >>HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Enum\USB\VID_067B&PID_2303\6&25c59972&0&1 >>>FriendlyName: Prolific USB-to-Serial Comm Port (COM4) Driver: {4d36e978-e325-11ce-bfc1-08002be10318}\0009 >>>>AttachedTo: >>HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Enum\USB\VID_067B&PID_2303\6&25c59972&0&2 >>>FriendlyName: Prolific USB-to-Serial Comm Port (COM6) Driver: {4d36e978-e325-11ce-bfc1-08002be10318}\0011 >>>>AttachedTo: >>HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Enum\USB\VID_067B&PID_2303\6&25c59972&0&3 >>>FriendlyName: Prolific USB-to-Serial Comm Port (COM7) Driver: {4d36e978-e325-11ce-bfc1-08002be10318}\0012 >>>>AttachedTo: >>HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Enum\USB\VID_067B&PID_2303\6&25c59972&0&4 >>>FriendlyName: Prolific USB-to-Serial Comm Port (COM5) Driver: {4d36e978-e325-11ce-bfc1-08002be10318}\0010 >>>>AttachedTo: >>HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Enum\USB\VID_067B&PID_2303\6&2d5dc42f&0&1 >>>FriendlyName: Prolific USB-to-Serial Comm Port (COM6) Driver: {4d36e978-e325-11ce-bfc1-08002be10318}\0005 >>>>AttachedTo: >>HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Enum\USB\VID_067B&PID_2303\6&2d5dc42f&0&2 >>>FriendlyName: Prolific USB-to-Serial Comm Port (COM5) Driver: {4d36e978-e325-11ce-bfc1-08002be10318}\0004 >>>>AttachedTo: >>HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Enum\USB\VID_067B&PID_2303\6&2d5dc42f&0&3 >>>FriendlyName: Prolific USB-to-Serial Comm Port (COM7) Driver: {4d36e978-e325-11ce-bfc1-08002be10318}\0006 >>>>AttachedTo: >>HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Enum\USB\VID_067B&PID_2303\7&1814f229&0&1 >>>FriendlyName: Prolific USB-to-Serial Comm Port (COM8) Driver: {4d36e978-e325-11ce-bfc1-08002be10318}\0007 >>>>AttachedTo: >>HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Enum\USB\VID_067B&PID_2303\7&c15003f&0&1 >>>FriendlyName: Prolific USB-to-Serial Comm Port (COM7) Driver: {4d36e978-e325-11ce-bfc1-08002be10318}\0016 >>>>AttachedTo: >HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Enum\USB\VID_0781&PID_5591 >>HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Enum\USB\VID_0781&PID_5591\4C530000230501200220 >>>FriendlyName: Driver: {36fc9e60-c465-11cf-8056-444553540000}\0015 >HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Enum\USB\VID_0BC2&PID_A003 >>HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Enum\USB\VID_0BC2&PID_A003\2HC015KJ >>>FriendlyName: Driver: {36fc9e60-c465-11cf-8056-444553540000}\0007 >HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Enum\USB\VID_2109&PID_0815 >>HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Enum\USB\VID_2109&PID_0815\5&2b1d7621&0&18 >>>FriendlyName: Driver: {36fc9e60-c465-11cf-8056-444553540000}\0012 >>HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Enum\USB\VID_2109&PID_0815\6&1d21882e&0&1 >>>FriendlyName: Driver: {36fc9e60-c465-11cf-8056-444553540000}\0014 >HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Enum\USB\VID_2109&PID_0817 >>HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Enum\USB\VID_2109&PID_0817\5&2b1d7621&0&18 >>>FriendlyName: Driver: {36fc9e60-c465-11cf-8056-444553540000}\0009 >HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Enum\USB\VID_2109&PID_2815 >>HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Enum\USB\VID_2109&PID_2815\5&2b1d7621&0&6 >>>FriendlyName: Driver: {36fc9e60-c465-11cf-8056-444553540000}\0011 >>HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Enum\USB\VID_2109&PID_2815\6&12e3460c&0&1 >>>FriendlyName: Driver: {36fc9e60-c465-11cf-8056-444553540000}\0013 >HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Enum\USB\VID_2109&PID_2817 >>HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Enum\USB\VID_2109&PID_2817\5&2b1d7621&0&6 >>>FriendlyName: Driver: {36fc9e60-c465-11cf-8056-444553540000}\0010 >HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Enum\USB\VID_5986&PID_2118 >>HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Enum\USB\VID_5986&PID_2118\5&2b1d7621&0&8 >>>FriendlyName: Driver: {36fc9e60-c465-11cf-8056-444553540000}\0003 >HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Enum\USB\VID_5986&PID_2118&MI_00 >>HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Enum\USB\VID_5986&PID_2118&MI_00\6&28310c7b&0&0000 >>>FriendlyName: Integrated Camera Driver: {ca3e7ab9-b4c3-4ae6-8251-579ef933890f}\0000 >>>>AttachedTo: >HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Enum\USB\VID_8087&PID_0A2B >>HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Enum\USB\VID_8087&PID_0A2B\5&2b1d7621&0&7 >>>FriendlyName: Driver: {e0cbf06c-cd8b-4647-bb8a-263b43f0f974}\0000 +>15:45:34 AutoIt3.exe ended.rc:0 +>15:45:34 AutoIt3Wrapper Finished. >Exit code: 0 Time: 12.16 Ya, this is the Console output @Danyfirex Link to comment Share on other sites More sharing options...
Danyfirex Posted March 13, 2021 Share Posted March 13, 2021 Hello Sorry for de long delay for some reason I was not seeing forum's notifications. Could You open Regedit go to this key "HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\Class\" and do a a search for "COM" or "COM3" or the one you're getting connected to, and show me the key value name, seems to be the the two used by the UDF does not match in your machine. Saludos mnkt 1 Danysys.com AutoIt... UDFs: VirusTotal API 2.0 UDF - libZPlay UDF - Apps: Guitar Tab Tester - VirusTotal Hash Checker Examples: Text-to-Speech ISpVoice Interface - Get installed applications - Enable/Disable Network connection PrintHookProc - WINTRUST - Mute Microphone Level - Get Connected NetWorks - Create NetWork Connection ShortCut Link to comment Share on other sites More sharing options...
mnkt Posted March 14, 2021 Author Share Posted March 14, 2021 8 hours ago, Danyfirex said: Hello Sorry for de long delay for some reason I was not seeing forum's notifications. Could You open Regedit go to this key "HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\Class\" and do a a search for "COM" or "COM3" or the one you're getting connected to, and show me the key value name, seems to be the the two used by the UDF does not match in your machine. Saludos Hi, I try with COM6, and do a search, nothing inside "Class" key. First and second found as in picture. Link to comment Share on other sites More sharing options...
Danyfirex Posted March 14, 2021 Share Posted March 14, 2021 Hello. Try this version. expandcollapse popup;~ #AutoIt3Wrapper_UseX64=y #include <ComUDF.au3> #include <Array.au3> Local $ports = _COM_ListPorts() ;an array with com ports Local $portdevices = _COM_ListPortDevices_Mod() ;2DArray DevicesName|COMPort _ArrayDisplay($ports, "2D display transposed") _ArrayDisplay($portdevices, "2D display transposed") Func _COM_ListPortDevices_Mod($bIsAvailable = False) Local $aCOMPorts = _COM_ListPorts() If Not IsArray($aCOMPorts) Then Return SetError(1, 0, 0) Local Const $sKeyUSB = "HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Enum\USB" Local $iIndex = 1 Local $iSubIndex = 1 Local $sSubKey = "" Local $sSubKeyChild = "" Local $sFriendlyName = "" Local $sDriver = "" Local $bFoundAll = False Local $sCOMPort = "" Local $hCOMPort = "" Local $aCOMDevices[256][3] Local $iIndexDevices = 0 Local $aCOMPort = 0 While True $sSubKey = RegEnumKey($sKeyUSB, $iIndex) If @error Then ExitLoop $iIndex += 1 $sSubKey = $sKeyUSB & "\" & $sSubKey $iSubIndex = 1 ConsoleWrite(@CRLF & @CRLF & ">" & $sSubKey & @CRLF) While True $sSubKeyChild = RegEnumKey($sSubKey, $iSubIndex) If @error Then ExitLoop $iSubIndex += 1 ConsoleWrite(">>" & $sSubKey & "\" & $sSubKeyChild & @CRLF) $sFriendlyName = RegRead($sSubKey & "\" & $sSubKeyChild, "FriendlyName") $sDriver = RegRead($sSubKey & "\" & $sSubKeyChild, "Driver") ConsoleWrite(">>>FriendlyName: " & $sFriendlyName & @TAB & "Driver: " & $sDriver & @CRLF) If $sFriendlyName = "" Then ContinueLoop $sCOMPort = RegRead("HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\Class\" & $sDriver, "AttachedTo") If $sCOMPort = "" Then $sCOMPort = RegRead("HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\Class\" & $sDriver, "AssignedPortForQCDevice") If $sCOMPort = "" Then $aCOMPort = StringRegExp($sFriendlyName, 'COM\d{1,}', 3) If IsArray($aCOMPort) Then $sCOMPort = $aCOMPort[0] EndIf ConsoleWrite(">>>>AttachedTo: " & $sCOMPort & @CRLF) If $sCOMPort = "" Then ContinueLoop ; not Attached ;check if exist in $aCOMPorts and remove it For $x = 0 To UBound($aCOMPorts) - 1 If $aCOMPorts[$x] = "" Then ContinueLoop If $aCOMPorts[$x] = $sCOMPort Then $aCOMDevices[$iIndexDevices][0] = $sFriendlyName $aCOMDevices[$iIndexDevices][1] = $sCOMPort $aCOMDevices[$iIndexDevices][2] = False If $bIsAvailable Then $hCOMPort = _COM_OpenPort($sCOMPort) $aCOMDevices[$iIndexDevices][2] = $hCOMPort <> -1 If $hCOMPort <> -1 Then _COM_ClosePort($hCOMPort) EndIf $iIndexDevices += 1 ExitLoop EndIf Next If UBound($aCOMPorts) = 0 Then $bFoundAll = True If $bFoundAll Then ExitLoop WEnd If $bFoundAll Then ExitLoop WEnd ReDim $aCOMDevices[$iIndexDevices][3] If $iIndexDevices Then Return SetError(0, $iIndexDevices, $aCOMDevices) Return SetError(2, 0, 0) EndFunc ;==>_COM_ListPortDevices_Mod Saludos Danysys.com AutoIt... UDFs: VirusTotal API 2.0 UDF - libZPlay UDF - Apps: Guitar Tab Tester - VirusTotal Hash Checker Examples: Text-to-Speech ISpVoice Interface - Get installed applications - Enable/Disable Network connection PrintHookProc - WINTRUST - Mute Microphone Level - Get Connected NetWorks - Create NetWork Connection ShortCut Link to comment Share on other sites More sharing options...
mnkt Posted March 17, 2021 Author Share Posted March 17, 2021 (edited) On 3/14/2021 at 7:13 PM, Danyfirex said: Hello. Try this version. expandcollapse popup;~ #AutoIt3Wrapper_UseX64=y #include <ComUDF.au3> #include <Array.au3> Local $ports = _COM_ListPorts() ;an array with com ports Local $portdevices = _COM_ListPortDevices_Mod() ;2DArray DevicesName|COMPort _ArrayDisplay($ports, "2D display transposed") _ArrayDisplay($portdevices, "2D display transposed") Func _COM_ListPortDevices_Mod($bIsAvailable = False) Local $aCOMPorts = _COM_ListPorts() If Not IsArray($aCOMPorts) Then Return SetError(1, 0, 0) Local Const $sKeyUSB = "HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Enum\USB" Local $iIndex = 1 Local $iSubIndex = 1 Local $sSubKey = "" Local $sSubKeyChild = "" Local $sFriendlyName = "" Local $sDriver = "" Local $bFoundAll = False Local $sCOMPort = "" Local $hCOMPort = "" Local $aCOMDevices[256][3] Local $iIndexDevices = 0 Local $aCOMPort = 0 While True $sSubKey = RegEnumKey($sKeyUSB, $iIndex) If @error Then ExitLoop $iIndex += 1 $sSubKey = $sKeyUSB & "\" & $sSubKey $iSubIndex = 1 ConsoleWrite(@CRLF & @CRLF & ">" & $sSubKey & @CRLF) While True $sSubKeyChild = RegEnumKey($sSubKey, $iSubIndex) If @error Then ExitLoop $iSubIndex += 1 ConsoleWrite(">>" & $sSubKey & "\" & $sSubKeyChild & @CRLF) $sFriendlyName = RegRead($sSubKey & "\" & $sSubKeyChild, "FriendlyName") $sDriver = RegRead($sSubKey & "\" & $sSubKeyChild, "Driver") ConsoleWrite(">>>FriendlyName: " & $sFriendlyName & @TAB & "Driver: " & $sDriver & @CRLF) If $sFriendlyName = "" Then ContinueLoop $sCOMPort = RegRead("HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\Class\" & $sDriver, "AttachedTo") If $sCOMPort = "" Then $sCOMPort = RegRead("HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\Class\" & $sDriver, "AssignedPortForQCDevice") If $sCOMPort = "" Then $aCOMPort = StringRegExp($sFriendlyName, 'COM\d{1,}', 3) If IsArray($aCOMPort) Then $sCOMPort = $aCOMPort[0] EndIf ConsoleWrite(">>>>AttachedTo: " & $sCOMPort & @CRLF) If $sCOMPort = "" Then ContinueLoop ; not Attached ;check if exist in $aCOMPorts and remove it For $x = 0 To UBound($aCOMPorts) - 1 If $aCOMPorts[$x] = "" Then ContinueLoop If $aCOMPorts[$x] = $sCOMPort Then $aCOMDevices[$iIndexDevices][0] = $sFriendlyName $aCOMDevices[$iIndexDevices][1] = $sCOMPort $aCOMDevices[$iIndexDevices][2] = False If $bIsAvailable Then $hCOMPort = _COM_OpenPort($sCOMPort) $aCOMDevices[$iIndexDevices][2] = $hCOMPort <> -1 If $hCOMPort <> -1 Then _COM_ClosePort($hCOMPort) EndIf $iIndexDevices += 1 ExitLoop EndIf Next If UBound($aCOMPorts) = 0 Then $bFoundAll = True If $bFoundAll Then ExitLoop WEnd If $bFoundAll Then ExitLoop WEnd ReDim $aCOMDevices[$iIndexDevices][3] If $iIndexDevices Then Return SetError(0, $iIndexDevices, $aCOMDevices) Return SetError(2, 0, 0) EndFunc ;==>_COM_ListPortDevices_Mod Dear Danyfirex, Saludos Edited March 17, 2021 by mnkt Link to comment Share on other sites More sharing options...
Danyfirex Posted March 17, 2021 Share Posted March 17, 2021 It seems to be there is something cached. It's really weird. I'll PM you. Saludos Danysys.com AutoIt... UDFs: VirusTotal API 2.0 UDF - libZPlay UDF - Apps: Guitar Tab Tester - VirusTotal Hash Checker Examples: Text-to-Speech ISpVoice Interface - Get installed applications - Enable/Disable Network connection PrintHookProc - WINTRUST - Mute Microphone Level - Get Connected NetWorks - Create NetWork Connection ShortCut Link to comment Share on other sites More sharing options...
Recommended Posts
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 accountSign in
Already have an account? Sign in here.
Sign In Now