Page 2 of 2 FirstFirst 12
Results 11 to 17 of 17

Thread: From Support: Detecting COMM port and attached device names (if any)

  1. #11
    thinBasic MVPs
    Join Date
    May 2007
    Location
    UK
    Posts
    1,427
    Rep Power
    159
    @Rick can you export that registry branch so I can have a look.

    @Eros I would suspect this is behaviour by design the usb RS232 adapter is after all a USB device so it appearing in the WMI_USBControllerDevice does make sense.

    I will do some skiing of the web and see what information turns up.
    Home Desktop : Windows 7 - Intel Pentium (D) - 3.0 Ghz - 2GB - Geforce 6800GS
    Home Laptop : WinXP Pro SP3 - Intel Centrino Duo - 1.73 Ghz - 2 GB - Intel GMA 950
    Home Laptop : Windows 10 - Intel(R) Core(TM) i5-4210U CPU @ 1.70GHz, 2401 Mhz, 2 Core(s), 4 Logical Processor(s) - 4 GB - Intel HD 4400
    Work Desktop : Windows 10 - Intel I7 - 4 Ghz - 8GB - Quadro Fx 370

  2. #12
    thinBasic MVPs
    Join Date
    May 2007
    Location
    UK
    Posts
    1,427
    Rep Power
    159
    Try this

    uses "WMI"
    Uses "OS"
    Uses "CONSOLE"
       
    Dim vData()       As String
    Dim nItems        As Long
    Dim Counter       As Long
    Dim Position      As Long
    Dim ComputerName  As String   Value OS_GetComputerName
    Dim sBuffer       As String
    Dim Ports()       As String
     
    sBuffer = WMI_GetData(ComputerName, "", "", "", "Win32_PnPEntity", "", "Name" )
     
    '---Parse returned data into single lines
    nItems = Parse( sBuffer, vData(), $CRLF)
     
    '---Print lines
    For Counter = 1 To nItems
      Position = InStr(Ucase$(vData(Counter)),"(COM")
      If Position Then 
        ReDim Preserve Ports(UBound(Ports)+1)
        PortS(UBound(Ports)) = Extract$(Position+1,vData(Counter),")")
      End If
    Next
    
    
    For Counter = LBound(Ports) To UBound(Ports)
      Console_WriteLine Ports(Counter)
    Next
    
    2011-07-06 - Test02-01 : Update amended code to look for "(COM" instead of "COMM PORT" this is a better solution.
    Attached Files Attached Files
    Last edited by Michael Clease; 06-07-2011 at 11:19.
    Home Desktop : Windows 7 - Intel Pentium (D) - 3.0 Ghz - 2GB - Geforce 6800GS
    Home Laptop : WinXP Pro SP3 - Intel Centrino Duo - 1.73 Ghz - 2 GB - Intel GMA 950
    Home Laptop : Windows 10 - Intel(R) Core(TM) i5-4210U CPU @ 1.70GHz, 2401 Mhz, 2 Core(s), 4 Logical Processor(s) - 4 GB - Intel HD 4400
    Work Desktop : Windows 10 - Intel I7 - 4 Ghz - 8GB - Quadro Fx 370

  3. #13
    Member
    Join Date
    Jan 2010
    Location
    Montreal, Canada
    Posts
    40
    Rep Power
    19
    Michael;

    That works!

    Registry branch attached per your request.

    Rick
    Attached Images Attached Images

  4. #14
    thinBasic MVPs
    Join Date
    May 2007
    Location
    UK
    Posts
    1,427
    Rep Power
    159
    Thanks Rick

    I was hoping you would export the serialcomm branch from the registry so I could look at the registry keys to see why the bluetooth ports didnt have numbers.

    Mike C.
    Home Desktop : Windows 7 - Intel Pentium (D) - 3.0 Ghz - 2GB - Geforce 6800GS
    Home Laptop : WinXP Pro SP3 - Intel Centrino Duo - 1.73 Ghz - 2 GB - Intel GMA 950
    Home Laptop : Windows 10 - Intel(R) Core(TM) i5-4210U CPU @ 1.70GHz, 2401 Mhz, 2 Core(s), 4 Logical Processor(s) - 4 GB - Intel HD 4400
    Work Desktop : Windows 10 - Intel I7 - 4 Ghz - 8GB - Quadro Fx 370

  5. #15
    Member
    Join Date
    Jan 2010
    Location
    Montreal, Canada
    Posts
    40
    Rep Power
    19
    Michael;

    I had attached a screen shot of Regedit to my previous post. Here is the export from Regedit of the branch. I had to zip it for it to be uploadable. The Bluetooth (virtual) ports seem to be the same as the usb-to-serial real one.

    Rick
    Attached Files Attached Files

  6. #16
    thinBasic MVPs
    Join Date
    May 2007
    Location
    UK
    Posts
    1,427
    Rep Power
    159
    Hello Rick,

    Thanks for the keys, I tried adding the keys (made a fake branch) and the ports numbers seem to be reported fine....v strange.

    Ive added the keys and the following script to the zip below can you give it a try and see what answers you get.

    Mike C.
    Attached Files Attached Files
    Home Desktop : Windows 7 - Intel Pentium (D) - 3.0 Ghz - 2GB - Geforce 6800GS
    Home Laptop : WinXP Pro SP3 - Intel Centrino Duo - 1.73 Ghz - 2 GB - Intel GMA 950
    Home Laptop : Windows 10 - Intel(R) Core(TM) i5-4210U CPU @ 1.70GHz, 2401 Mhz, 2 Core(s), 4 Logical Processor(s) - 4 GB - Intel HD 4400
    Work Desktop : Windows 10 - Intel I7 - 4 Ghz - 8GB - Quadro Fx 370

  7. #17
    Member
    Join Date
    Jan 2010
    Location
    Montreal, Canada
    Posts
    40
    Rep Power
    19
    Michael;

    Not adventurous enough to add records to my registry! The fact that I have a workaround is good enough for me. Doesn't satisfy Eros' desire to know why WMI doesn't work, tho... Many thanks.

    Rick

Page 2 of 2 FirstFirst 12

Similar Threads

  1. OpenCL: Device information [Updated Sep 04 2011]
    By Petr Schreiber in forum OpenCL
    Replies: 14
    Last Post: 09-02-2010, 14:09

Members who have read this thread: 0

There are no members to list at the moment.

Tags for this Thread

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •