Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

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

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.

like image 977
this-Me Avatar asked Sep 19 '11 10:09

this-Me


1 Answers

try this:

netsh interface set interface "YOUR_ADAPTOR" DISABLED
like image 160
unruledboy Avatar answered Sep 28 '22 14:09

unruledboy