How to remove hidden,lost or missing network cards and delete them.

I recently had a issue with my network cards on Windows 2008 R2 where after a reboot they would switch to a new card (It didn't happen after every reboot but more often than I would like) and the IP information would disappear.

for example:

I had the IP configured on a LAN connection called "Local Areas Network 3" and after a reboot this morning the server was not accessible and when we logged in through the console physically it had changed to "Local Area Connection 7" and was set to DHCP. I had to manually re-assign the static Ip again on this adapter and it gave me an information box as below.



So i clicked yes on that and after that the server started responding and I was now able to perform a remote desktop and login. So now I had to figure out a way to delete the "ghost" adapters from device management and here is how you can do that.


Open the command prompt  using the elevated privileges if you are on Windows 2008.

In the command prompt type:  set devmgr_show_nonpresent_devices=1 

without closing the window open Device Management from the same command prompt by typing --> devmgmt.msc

Click View and then Show Hidden Devices

Expand Network Adapters section and "Uninstall" the ones that you think you will never need but be careful as to which one you select and remove!