Disable (or switch off) a network interface on windows but keep the "plug and play"
- by Leandro
I'm looking for a good workaround to do this on Windows 7 and Windows XP:
Disable or make ineffective the network interface (ETH, WIFI, any NIC).
If the user connect his ETH cable, the network interface enable again.
Important Notes to take care:
I'm working with wmic on Win7 (through the command line)
I'm working with devcon on WinXP (through the command line)
I'm specifically working with the .NET Framework 2.0 on C# but this is just for informational purposes.
I know that an event won't help me to detect it (if there is a way or workaround to do this I don't know it).
The real problem is that when I disable the NIC, I can't know if the user connects his cable or has a wired network. This is why I am looking for a workaround.
I'll treat suggestions as answers if no direct answer exists. I'll provide any extra detail necessary.