Removing a Missing Network Adapter

I recently hit a problem with one of my virtual machines.  I had copied a virtual hard disk from one server to another, created a new virtual machine that used this virtual hard disk, and found that my scripts did not work anymore.  After a bit of inspection I realized what was going on - in moving the virtual hard disk, without the configuration file, I had created a new virtual network adapter.  My script was still referencing the old network adapter. 

Fortunately, I know a handy way to get Windows to forget about old network adapters.  You cannot just open Device Manager and remove the old network adapter - as it will not show it to you.  What you need to do is:

  1. Open a command prompt
  2. Type in "set devmgr_show_nonpresent_devices=1"
  3. Then type in "devmgmt.msc"
  4. Now, click Show hidden devices on the View menu in Device Manager
  5. At this stage you should be able to see the missing network adapter - and you can just right click on it and choose to Uninstall it.

Once I had done this - my script worked perfectly.

Cheers,
Ben