Is the PNPDeviceID unique

2020-02-15 01:32发布

I wonder if the PNPDeviceID of an USB drive is unique (at least a charge of identic devices) and if the ID does not change.

Thanks in advance.

标签: wmi-query
1条回答
SAY GOODBYE
2楼-- · 2020-02-15 02:08

As far as I know -- No. For example, "USBSTOR\DISK&VEN_LG&PROD_USB_DRIVE&REV_1100\AA04012700014149&0" - is a device id of a usb stick. For all such given usb sticks device id will be the same. But Windows adds an instance id of device ("&0"), so it can distinguish them. If you plug two same usb sticks the device id of each of them will be different, for example: USBSTOR\DISK&VEN_LG&PROD_USB_DRIVE&REV_1100\AA04012700014149&0 USBSTOR\DISK&VEN_LG&PROD_USB_DRIVE&REV_1100\AA04012700014149&1

P.S. Sometimes Windows doesn't add instance of a device, if another same device isn't plugged. (I don't know why)

查看更多
登录 后发表回答