Turn on Wireless Card from Command Line
Hi,
Is there a way to write a batch file or a command line that sets up a connection in the network connections for my wireless network ? I have a program that requires that the network is disconnected when I use it. I think the solution may be a bat file. I therefore need a bat file interrupting network before starting the program.
Can you help me??
Re: Turn on Wireless Card from Command Line
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.
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.
http://gallery.techarena.in/data/516...evice-name.jpg
For example, the line below matches the device name for the Dell Internal Card shown in above image.
PCI\VEN_14E4&DEV_4319&SUBSYS_00051028&REV_02\4&2FA23535&0&18F0
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.