2

是否可以使用 devon.exe 按名称删除 USB 大容量存储设备?以下代码用于删除所有设备:

Devcon remove usbstor\*

但现在我想删除一个特定的设备。例如,如果插入了 5 个 USB,ABCDEF,我现在只想移除B。我知道实例 id 用于此目的,但是否可以使用设备名称删除?例如,像

Devcon remove usbstor\B

我试过这个,但它不起作用。

4

1 回答 1

2

您可以通过硬件 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.)
于 2012-07-31T13:45:41.300 回答