Devcon.exe通过HwIDs查询设备

任何设备的与驱动都是通过设备的硬件ID进行关联的。
设备的ID用于标识设备的身份,DevCon.exe关于ID的操作都是通过HwIDs参数来执行的。

设备的ID包括:硬件ID、兼容ID和设备实例ID.

Devcon.exe HwIDs语法

devcon [/m:\\computer] hwids {* | ID [ID ...] | =class [ID [ID ...]]}
  • /m: \\computer在指定的远程计算机上运行命令。如果使用该参数表示在本机执行。
  • hwids :使用HwIDs命令查询设备
  • *:表示设备的ID的通配符,使用@来表示实例ID.
  • =class:使用类名查询

Devcon.exe使用示例

devcon hwids *     //显示系统中所有的设备
devcon /m:\\server01 hwids acpi*    //显示远程计算机server01上的设备ID含有acpi的设备
devcon hwids acpi* *port*        //显示系统中的 acpi和port设备
devcon hwids =usb               //显示usb类下的所有设备,详见Classes

显示系统中的所有设备

devcon hwids *

导出系统中所有的设备到记事本

devcon hwids * > hwids.txt

导出远程计算机中的所有设备到记事本

devcon /m:\\server01 hwids * > server01_hwids.txt

显示本机硬件ID中版本为0024的所有设备

devcon hwids *REV_0024*
C:\Program Files (x86)\Windows Kits\10\Tools\x64>devcon hwids *REV_0024*
USB\VID_12D1&PID_3A07&MI_00\6&A006C3D&0&0000
    Name: HUAWEI USB-C HEADSET
    Hardware IDs:
        USB\VID_12D1&PID_3A07&REV_0024&MI_00
        USB\VID_12D1&PID_3A07&MI_00
    Compatible IDs:
        USB\Class_01&SubClass_01&Prot_00
        USB\Class_01&SubClass_01
        USB\Class_01
USB\VID_12D1&PID_3A07\0296A100000000000000000000000
    Name: USB Composite Device
    Hardware IDs:
        USB\VID_12D1&PID_3A07&REV_0024
        USB\VID_12D1&PID_3A07
    Compatible IDs:
        USB\DevClass_00&SubClass_00&Prot_00
        USB\DevClass_00&SubClass_00
        USB\DevClass_00
        USB\COMPOSITE
HID\VID_12D1&PID_3A07&MI_03\7&288CEA76&0&0000
    Name:     Hardware IDs:
        HID\VID_12D1&PID_3A07&REV_0024&MI_03
        HID\VID_12D1&PID_3A07&MI_03
        HID\VID_12D1&UP:000C_U:0001
        HID_DEVICE_SYSTEM_CONSUMER
        HID_DEVICE_UP:000C_U:0001
        HID_DEVICE
USB\VID_12D1&PID_3A07&MI_03\6&A006C3D&0&0003
    Name: USB     Hardware IDs:
        USB\VID_12D1&PID_3A07&REV_0024&MI_03
        USB\VID_12D1&PID_3A07&MI_03
    Compatible IDs:
        USB\Class_03&SubClass_00&Prot_00
        USB\Class_03&SubClass_00
        USB\Class_03
4 matching device(s) found.

显示本机中USB类下的所有设备

devcon hwids =usb
C:\Program Files (x86)\Windows Kits\10\Tools\x64>devcon hwids =usb
PCI\VEN_8086&DEV_34ED&SUBSYS_097B1028&REV_30\3&11583659&1&A0
    Name: Intel(R) USB 3.10     Hardware IDs:
        PCI\VEN_8086&DEV_34ED&SUBSYS_097B1028&REV_30
        PCI\VEN_8086&DEV_34ED&SUBSYS_097B1028
        PCI\VEN_8086&DEV_34ED&CC_0C0330
        PCI\VEN_8086&DEV_34ED&CC_0C03
    Compatible IDs:
        PCI\VEN_8086&DEV_34ED&REV_30
        PCI\VEN_8086&DEV_34ED
        PCI\VEN_8086&CC_0C0330
        PCI\VEN_8086&CC_0C03
        PCI\VEN_8086
        PCI\CC_0C0330
        PCI\CC_0C03
USB\VID_05E3&PID_0610\5&143D6412&0&2
    Name:     Hardware IDs:
        USB\VID_05E3&PID_0610&REV_0655
        USB\VID_05E3&PID_0610
    Compatible IDs:
        USB\USB20_HUB
USB\VID_12D1&PID_3A07\0296A100000000000000000000000
    Name: USB Composite Device
    Hardware IDs:
        USB\VID_12D1&PID_3A07&REV_0024
        USB\VID_12D1&PID_3A07
    Compatible IDs:
        USB\DevClass_00&SubClass_00&Prot_00
        USB\DevClass_00&SubClass_00
        USB\DevClass_00
        USB\COMPOSITE
USB\ROOT_HUB30\4&2DD4AF6A&0&0
    Name: USB     Hardware IDs:
        USB\ROOT_HUB30&VID8086&PID34ED&REV0030
        USB\ROOT_HUB30&VID8086&PID34ED
        USB\ROOT_HUB30
USB\VID_0C45&PID_671E\5&143D6412&0&6
    Name: USB Composite Device
    Hardware IDs:
        USB\VID_0C45&PID_671E&REV_8502
        USB\VID_0C45&PID_671E
    Compatible IDs:
        USB\DevClass_00&SubClass_00&Prot_00
        USB\DevClass_00&SubClass_00
        USB\DevClass_00
        USB\COMPOSITE
USB\VID_05E3&PID_0626\5&143D6412&0&14
    Name:     Hardware IDs:
        USB\VID_05E3&PID_0626&REV_0655
        USB\VID_05E3&PID_0626
    Compatible IDs:
        USB\USB30_HUB
6 matching device(s) found.

显示实例ID为0009的设备

devcon hwids @*0009*
C:\Program Files (x86)\Windows Kits\10\Tools\x64>devcon hwids @*0009*
HID\INTC816&COL0A\3&DC5EADA&0&0009
    Name:     Hardware IDs:
        HID\INTC816&Col0A
        HID\VID_8087&UP:000C_U:0001
        HID_DEVICE_SYSTEM_CONSUMER
        HID_DEVICE_UP:000C_U:0001
        HID_DEVICE
STORAGE\VOLUME\{EC0C828F-638A-11EA-9666-806E6F6E6963}#0000009A0124BE00
    Name:     Hardware IDs:
        STORAGE\Volume
2 matching device(s) found.

参考资料:https://docs.microsoft.com/en-us/windows-hardware/drivers/devtest/devcon-examples

取消
感谢您的支持,我会继续努力的!
扫码支持
扫码打赏,你说多少就多少

打开支付宝扫一扫,即可进行扫码打赏哦

Powered by bytekits.com,汇天下文字,成非凡梦想!!!