title: Get the string with parent of device
body: <p>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:</p>
  
  <p><a href="https://i.stack.imgur.com/6DcjP.png" rel="nofollow"><img src="https://i.stack.imgur.com/6DcjP.png" alt="enter image description here"></a></p>
  
  <p>How I can obtain this string from vb .net or another language in visual studio in cmd also will be good?</p>
  
  <p>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".</p>
  
  <pre><code> 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 &amp; vbCrLf)
  
              Console.Write(objPort.DeviceID &amp; vbCrLf)
              Console.ReadLine()
  
          Next
  </code></pre>
  
  <p>Except Device ID I try Caption and all syntax that available in <a href="https://msdn.microsoft.com/en-us/library/aa394413%28v=vs.85%29.aspx?f=255&amp;MSPPError=-2147217396" rel="nofollow">List</a>.
  Do you have any idea, please?</p>