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:
- Open a command prompt
- Type in “set devmgr_show_nonpresent_devices=1″
- Then type in “devmgmt.msc”
- Now, click Show hidden devices on the View menu in Device Manager
- 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.