0

When I try to show my serial ports on Win 7 x32 by friendly name whether it is physical or virtual it works, but when I try it on Win 8.1 x64 only the virtual port shows. When I remove the virtual it doesn`t show me any error in fact it just loads the form.

Try
     'Dim searcher As New ManagementObjectSearcher("root\cimv2", "SELECT * FROM Win32_SerialPort where Description='Prolific USB-to-Serial Comm Port'")
      Dim searcher As New ManagementObjectSearcher("root\cimv2", "SELECT * FROM Win32_SerialPort ")
      For Each queryObj As ManagementObject In searcher.Get()
          RichTextBox1.Text &= queryObj("Name") & Chr(32) & queryObj("DeviceID") & vbCr
      Next

Catch err As ManagementException
      MessageBox.Show("An error occurred while querying for WMI data: " & err.Message)
End Try

Almost forgot I am trying to detect USB to RS-232 but no luck.

Jim Hewitt
  • 1,726
  • 4
  • 24
  • 26
MORagab
  • 71
  • 1
  • 1
  • 5
  • Take a look at the accepted answer [here](http://stackoverflow.com/questions/34034688/wmi-not-working-after-upgrading-to-windows-10). It's about Windows 10, but might be useful. – Jim Hewitt Jul 21 '16 at 05:17
  • i tried something like that but i am looking for something that make the code look nice i will try again and thanks for the advice – MORagab Jul 26 '16 at 00:39

0 Answers0