Devcon的用法 (
#列出所有PCI设备的ID
Devcon find pci\*
如:
PCI\VEN_10EC&DEV_8139&SUBSYS_813910EC&REV_10\4&172A2BDD&0&18F0: Realtek RTL8139
Family PCI Fast Ethernet NIC
其中 : 号前面的 PCI\VEN_10EC 就是设备 ID 号。后面的是设备名称。ID 号也可以用 *DEV_8139* 来表示。
#开启设备命令:
Devcon enable PCI\VEN_10EC
或者写成
Devcon enable *DEV_8139*
#禁用设备命令:
Devcon disable PCI\VEN_10EC
或者写在成
Devcon disable *DEV_8139*
禁用设备的命令是:
devcon disable 设备ID
这个设备ID怎么得到呢?可以通过设备管理器,在设备上点击“属性”,在“详细信息”标签里面有个下拉列表,选择“设备范例Id”,下面显示出来的就是设备ID,直接CTRL+C就OK了。
2、设备ID不能直接输入,否则会把ID开头相同的一大堆设备都操作一遍,最后还会出几个错误提示;加上双引号也不行,会提示没有设备被禁用/启用;必须这样写:@"设备ID",所以最后的命令格式是:
devcon disable @"设备ID"
如:
devcon disable @"PCI\VEN_10EC&DEV_8139&SUBSYS_813910EC&REV_10\4&172A2BDD&0&18F0"
各设备分类(class)标准 列表
00 Use class information in the Interface Descriptors
01 Audio
02 Communications and CDC Control
03 HID (Human Interface Device)
05 Physical
06 Image
07 Printer
08 Mass Storage
09 Hub
0A CDC-Data
0B Smart Card
0D Content Security
0E Video
0F Personal Healthcare
DC Diagnostic Device
E0 Wireless Controller
EF Miscellaneous
FE Application Specific
FF Vendor Specific
关闭类设备:
devcon.exe disable USB\Class_08
禁用U盘,即删除U盘,不管你有N个U盘统统一起删除
devcon.exe disable USB\Class_06
禁用数码相机,包括数码相机附带的可移动磁盘
devcon.exe disable USB\Class_03
禁用USB鼠标&键盘
devcon.exe disable USB\Class_ff
12-16