如何使用批处理脚本删除 Windows 7 中的环回适配器?

如何使用批处理脚本删除 Windows 7 中的环回适配器?

我已经使用 devcon 在 Windows 7 上创建了 10 个环回适配器

devcon -r install %WINDIR%\Inf\Netloop.inf *MSLOOP

我将其放入 for 循环中,一切正常,但现在我想使用批处理脚本删除它们?怎么做?我发现我可以禁用它们,但我想不断删除它们,而不仅仅是禁用它们。如果有办法使用开发者大会再次?

Device Console Help:
devcon [-r] [-m:\\<machine>] <command> [<arg>...]
-r           Reboots the system only when a restart or reboot is required.
<machine>    Specifies a remote computer.
<command>    Specifies a Devcon command (see command list below).
<arg>...     One or more arguments that modify a command.
For help with a specific command, type: devcon help <command>
classfilter          Add, delete, and reorder class filters.
classes              List all device setup classes.
disable              Disable devices.
driverfiles          List installed driver files for devices.
drivernodes          List driver nodes of devices.
enable               Enable devices.
find                 Find devices.
findall              Find devices, including those that are not currently attached.
help                 Display Devcon help.
hwids                List hardware IDs of devices.
install              Install a device manually.
remove               Remove devices.

...

答案1

删除所有环回适配器

devcon /r remove =net "@ROOT\NET\*"

=net课程在哪里

@ROOT\NET\*是所有通配符ID适配器。

要显示适配器的名称,请写入:

devcon status =net "@ROOT\NET\*"

相关内容