In device manager of windows7 in com port's branch I choose menu "properties" one of port. In tab of "details" I chose property "parent" and see the string:
How I can obtain this string from vb .net or another language in visual studio in cmd also will be good?
I tried to use win32_ clases: pnpentity, serialPort etc but this no solved to my problem even output of Get-WMIObject Win32_SerialPort in PS had not property "parent".
Dim objService = GetObject("winmgmts://./root/cimv2")
For Each objPort In objService.ExecQuery("SELECT * FROM Win32_PnPEntity WHERE ClassGuid='{4d36e978-e325-11ce-bfc1-08002be10318}'")
Console.WriteLine(objPort.Caption & vbCrLf)
Console.Write(objPort.DeviceID & vbCrLf)
Console.ReadLine()
Next
Except Device ID I try Caption and all syntax that available in List. Do you have any idea, please?