Welcome to OStack Knowledge Sharing Community for programmer and developer-Open, Learning and Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
638 views
in Technique[技术] by (71.8m points)

wmi query - Is the PNPDeviceID unique

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

See Question&Answers more detail:os

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome To Ask or Share your Answers For Others

1 Answer

0 votes
by (71.8m points)

As far as I know -- No. For example, "USBSTORDISK&VEN_LG&PROD_USB_DRIVE&REV_1100AA04012700014149&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: USBSTORDISK&VEN_LG&PROD_USB_DRIVE&REV_1100AA04012700014149&0 USBSTORDISK&VEN_LG&PROD_USB_DRIVE&REV_1100AA04012700014149&1

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


与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome to OStack Knowledge Sharing Community for programmer and developer-Open, Learning and Share
Click Here to Ask a Question

...