How to disable (or reset) a network adapter programmatically in C#

this-Me picture this-Me · Sep 19, 2011 · Viewed 12k times · Source

I need to disable a network adapter programmatically using C# (.NET 2.0) on Windows XP Embedded.

Background Reason: After installing a Bluetooth stack on the PC, the Bluetooth PAN adapter blocks the Bluetooth manager program (that runs in the system tray). If I disable the Bluetooth PAN then the Bluetooth manager works fine.

This issue is happening only on Windows XP Embedded machines.

Answer

unruledboy picture unruledboy · Sep 19, 2011

try this:

netsh interface set interface "YOUR_ADAPTOR" DISABLED