Enable/Disable Wireless Card from Command Line

Why Command Line?

Using the graphical user interface to enable or disable a wireless card is easy but usually requires multiple clicks of the mouse.  Having a command line method to enable/disable a wireless card or any network interface is faster and more powerful. Also, a command line method is easy to use in scripts.

DevCon Utility

To do this in Windows XP a command utility called DevCon can be used.

The DevCon utility is a command-line utility that acts as an alternative to Device Manager. Using DevCon, you can enable, disable, restart, update, remove, and query individual devices or groups of devices. DevCon also provides information that is relevant to the driver developer and is not available in Device Manager.

You can use DevCon with Microsoft Windows 2000, Windows XP, and Windows Server 2003. You cannot use DevCon with Windows 95, Windows 98, or Windows Millennium Edition.

Download DevCon from Microsoft.com

Download DevCon package from Microsoft.com by clicking here and extract the package and copy the appropriate version (file in I386 folder for 32 bit Windows or file in Ia64 folder for 64 bit windows) to the C:\windows\system32\ folder.

To test if you have devcon properly running open a command prompt window and type “devcon help”. The results should look like below.

DevCon Help

Determining Device Instance ID

The command format to disable a device is devcon disable <specific hardware or instance ID>.

Before this command can be used the instance ID for the wireless card being disabled is needed.

The easiest way to find the “specific hardware or instance ID” of your wireless card is to match the device name in windows network connections list to the results of the command devcon hwids “*” > c:\hwids.txt

Look in output text file for a line that contains the device name of the wireless card.

Wireless Card Device Name

 For example, the line below matches the device name for the Dell Internal Card shown in above image.

    Name: Dell Wireless 1470 Dual Band WLAN Mini-PCI Card

In the above line the device instance ID is “DEV_4319” without the “&”.

So the commands to enable and disable the wireless card from the command line would be “devcon disable *DEV_4319*”

Disable Wireless Card from Command Line

To disable the wireless card, execute the command below at command prompt. 

C:\>devcon disable *DEV_4319*
PCI\VEN_14E4&DEV_4319&SUBSYS_00051028&REV_02\4&2FA23535&0&18F0: Disabled
1 device(s) disabled.

Enable Wireless Card from Command Line

To enable the wireless card, execute the command below at command prompt.  

C:\>devcon enable *DEV_4319*
PCI\VEN_14E4&DEV_4319&SUBSYS_00051028&REV_02\4&2FA23535&0&18F0: Enabled
1 device(s) enabled.

DevCon page http://support.microsoft.com/kb/311272

If you liked this post, subscribe using below

WLAN Book RSS Feed

RSS Email WLAN Book by Email


Filed under: How To Guides

3 Responses to “Enable/Disable Wireless Card from Command Line”

  1. […] How to enable/disable a wireless card using the command line. […]

  2. […] Enable/Disable Wireless Cards Using Command Line […]