是否可以使用devon.exe按名称删除U盘大容量存储设备?以下代码用于删除所有设备:
Devcon remove usbstor\*但现在我想删除一个特定的设备。例如,如果插入了5个USB:A、B、C、D、E和F,我现在只想删除B。我知道实例id用于此目的,但是否可以使用设备名称删除?例如,像这样
Devcon remove usbstor\B我试过了,但不起作用。
发布于 2012-07-31 21:45:41
您可以通过硬件ID删除单个设备。如果您知道id,则可以使用remove命令,否则您必须找到硬件id。有关详细信息,请参阅帮助:
Devcon Remove Command
Removes devices with the specified hardware or instance ID. Valid only on
the local computer. (To reboot when necesary, Include -r .)
Devcon.exe [-r] remove <id> [<id>...]
Devcon.exe [-r] remove =<class> [<id>...]
<class> Specifies a device setup class.
Examples of <id>:
* - All devices
ISAPNP\PNP0501 - Hardware ID
*PNP* - Hardware ID with wildcards (* matches anything)
@ISAPNP\*\* - Instance ID with wildcards (@ prefixes instance ID)
'*PNP0501 - Hardware ID with apostrophe (' prefixes literal match - matches exactly as typed,
including the asterisk.)https://stackoverflow.com/questions/10534983
复制相似问题