6

I'm working on developing a WMI query for my application. It needs to find the assigned virtual COM port for a given VID/PID. Using the WMI Code Creator I have found that...

  • Namespace: root\CIMV2
  • Class: Win32_SerialPort
  • Property: PNPDeviceID

...returns a value of USB\VID_10C4&PID_EA60\0001. This same value can be found by going to the appropriate entry in Device Manager -> Properties -> Details tab and selecting Device Instance Id.

My question is, what does the \0001 signify? Or, can I expect my device to have a device ID of USB\VID_10C4&PID_EA60\0001 when plugged into any Windows system? Thanks.

Jim Fell
  • 13,750
  • 36
  • 127
  • 202

1 Answers1

4

It references the device instance. That is, devices with identical identifiers (more than one plugged in) are enumerated, so that the system can identify them.

http://forums.techguy.org/software-development/959095-solved-pnpdeviceid-format.html#3

Jim Fell
  • 13,750
  • 36
  • 127
  • 202
  • Does that mean that the PNPDeviceID is no unique ID to identify an USB flash drive for example? – L4c0573 Feb 25 '16 at 11:48
  • @L4c0573 Correct, two USB flash drives will have identical first two parts of `PNPDeviceId` (`USB\VID_10C4&PID_EA60`), while the last third part will depend on port/slot you inserted the drive (`0001`). You want to get serial number to identify a device. Try this PowerShell command: `gwmi Win32_DiskDrive | Format-Table PNPDeviceId,DeviceId,Model,SerialNumber`. – George Sovetov Apr 17 '19 at 16:02