How to delete loopback adaptor in Windows 7 using batch script?

1

1

I have created 10 loopback adaptors on Windows 7 using devcon

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

I put this in for loop and every thing is ok but now I want to delete them using batch script? How to do that? I found that I can disable them ,but I want to delete them constantly, not just to disable them. If there some way to use devcon again?

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.

...

Xelian

Posted 2014-11-03T10:42:23.237

Reputation: 111

devcon remove ...? – DavidPostill – 2014-11-03T10:51:36.363

remove but how to specify the adapter name,ID what to pass to this remove? – Xelian – 2014-11-03T11:05:43.223

1devcon hwids ... will list the device ids. See Device Console (DevCon.exe) Examples for lots of examples on using devcon – DavidPostill – 2014-11-03T11:12:42.597

I just was looking this site, I try to display all loopback adapters using devcon findAll Loopbackbut nothing happens? – Xelian – 2014-11-03T11:24:35.613

devcon status "@ROOT\NET*" ,but the name of the adaper is Microsoft Loopback Adater, not the name specified by myself, so I can't search for the adapters only to remove all. – Xelian – 2014-11-03T12:11:22.643

Answers

0

To remove All Loopback adaptors

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

where =net is a class

@ROOT\NET\* is wildcard for all IDs of the adapters.

To show the name of the adapters write:

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

Xelian

Posted 2014-11-03T10:42:23.237

Reputation: 111