How can I disable at application level a network interface?
The main question is this:
If I disable the nic trough wmic (win7) or devcon (XP), the "plug and play" of a wired nic doesn't work any more. For example, if the user put the cable on a disabled nic, the OS doesn't know about it.
So I need to persist the enable condition but disabling the networking like a disable nic.
There's some API, network configuration (routing, changing ip, changing gateway, any), .NET Framework resource (Only NetFramework 2.0) or do you can think in any workaround to do this?
Suggest and ideas also will be treated as a solution.
Thanks and kind regards.
Edit: The why:
I'm doing an application required by a third part company for resolve a non-responsable people issue.
The main idea of the application is automatically "disable" (so far don't think by 'disable' is disabling the nic), so automatically "disable" a selected wired.
But in some conditions, for example a DNS shutdown or something like, if the user plugs the utp cable on the eth, the app needs to know if is wired, to up the nic.
The application has a workflow oriented to "don't be a fool" behavior. So we need take care about all conditions, for experts users or newbies.
Suppose this case:
nic A is enabled and up. nic B is enabled and down.
User connects cable B.
nic B is enabled and up.
Application disables connection B.
nic B is disabled.
User disconnects cable B.
nic A is enabled, up but doesn't have internet connection. (For third-company is a "down" case)
App disables nic A.
App can NOT enable nic B when users reconnects cable B.
So far, there is a lots of combinations.