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.
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.
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.
Â 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*
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*
1 device(s) enabled.
DevCon page http://support.microsoft.com/kb/311272
If you liked this post, subscribe using below
Filed under: How To Guides