Search code examples
windowscmdwmivirtualboxwmic

Deleting a NIC using wmic


I am trying to remove a lot of Virtualbox NICs that were created with docker toolbox using the command line (clicking them one for one is too much work and I will probably need to do this more in the future). So far I have the following command:

wmic nic where Description="VirtualBox Host-Only Ethernet Adapter" delete /INTERACTIVE

Interactive is there so I can double check. However when it tries to delete the first adapter I get the following error:

ERROR: 
Description = Provider is not capable of the attempted operation

I am executing this command as administrator.

How can I delete these (virtual host only) NIC's?


Solution

  • I found a solution to remove all Virtualbox adapters, using the following command:

    devcon remove *VBox*
    

    For this to work you need to download the DevCon utility. I got it for Windows 7 here: http://techlikes.com/2010/09/25/devcon-problem-in-windows-7-solved.html#comment-196743312