Windows 7 Script for turning lan connection on/off

MrLH

Senior Member
I had this wonderful script that I got from someplace (can't recall) that enabled or disabled lan connections in windows xp. I used it to turn the wireless card on/off as the card made clicking noises during recording/playback of music files. I have just performed a clean install of windows 7 and am migrating backed up files and programs but can't find the script anywhere in my backup. Does anyone know of such a script and can it be used in windows 7? I'd hate to have to hop through several screens everytime I want to turn it off/on and think there must be a simpler way to get it done. Any ideas or places to direct my attention to?
 
Start elevated Command Prompt.

Get NIC list and index number:
wmic nic get name, index

Enable NIC with index number: (eg: 7)
wmic path win32_networkadapter where index=7 call enable

Disable NIC with index number: (eg: 7)
wmic path win32_networkadapter where index=7 call disable

Result:
wmic path win32_networkadapter where NetConnectionID="Wireless Network Connection" call disable
wmic path win32_networkadapter where NetConnectionID="Wireless Network Connection" call enable

Create two shortcuts, run as elevated.
A further answer about this can be found here: http://answers.microsoft.com/en-us/...and-line/17a21634-c5dd-4038-bc0a-d739209f5081
 
Can also use

netsh interface set interface "Wireless Network Connection" enabled
netsh interface set interface "Wireless Network Connection" disabled

Don't forget to replace the name of "Wireless Network Connection" with the name of your connection as found in Network Connections.
 
Thanks guys, sorry it took so long to get back to you but have been extremely busy. I have been able to get it done and both suggestions work fine. These are incredibly easy to employ, the script I had was a VB script and had lots of lines, stuff I could never remember if my life depended on it but it worked as a stand alone item. I don't mind a turn on icon and a turn off icon though, it gets the job done. Thanks again!
 
Here i face a different challenge still with wlan.
My wlan and Bluetooth swiches are powered by a touch sensor.
The Flex cable connecting this touch panel went bad so i cannot turn on the wlan and Btooth hardware.

How can i work around this till i replace the flex cable.
 
Chances are you will not be able to do this, unless your BIOS supports disabling this switch all together somehow. What model of laptop (I'm assuming) uses a touch sensor for turning radio on/off ??
 
Is there a Function-F8 key combo that might work?
 
Back
Top