HOW-TO: Automatically Disable WIFI on LAN Connectivity

Wifi networks are just about everywhere. In this digital age, being offline is tantamount to living in the stone age. Little do people know, the abundance of Wifi signals in the environment causes a lot of headaches. The signals coming from both the devices and the Wifi infrastructure cause a lot of unseen interference. Leaving devices with inherent wireless connectivity online, while unused, contributes to that phenomenon. As the interference increases, performance worsens.

If you ask me, I prefer to be connected wired rather than wireless. Wired connectivity is stable, and if you really want performance -- it is way faster. Imagine comparing the fastest wireless (Wireless N), at 300MBps with the fastest wired (Gigabit Ethernet) at 1GBps. Enterprise wired networks could go as fast as 10GBps. Not to mention, the 300MBps wireless speed varies over distance and the density of connected devices on the wireless infrastructure.

One such device is your average notebook. It has both wifi and wired connectivity. I previously wrote about putting preference of Wired connectivity over Wifi, if both are available. Now, I'd like to write about automatically shutting down the wireless interface when the wired interface is connected. It is also possible to automate the enabling of the wireless interface once the LAN is disconnected.

As I am still on Windows 7, the screenshots are based on the Windows 7 interface but the procedure is applicable to modern variants of Windows. Let's dive into the nitty gritty details.

Open the native Windows "Event Viewer" and browse to Windows Logs --> System. Create events of the LAN interface connecting and disconnecting by physically connecting and disconnecting the LAN cable. Pressing "Refresh" on the right panel will show the recent events. On my notebook, the EventIDs are #33 and #27 for connections and disconnections, respectively.

Highlight an EventID #33 and select "Attach Task To This Event.." (as seen on the screenshot below).

System Event Logs

Put an appropriate name to the Task. Description is optional, but put one in anyway. Next..

Create Basic Task

Nothing to do in the next Window as everything is greyed out.. Next..

Just Hit Next..

Accept the default action of "Start a program". Next..

Start a program

The program to start is "C:\Windows\system32\netsh.exe". For the arguments, add:
interface set interface "Wireless Network Connection" disable


Hit Next.. and Finish.

Hit Finish

Run this task as "NTAUTHORITY\SYSTEM" and tick "Run with highest privileges".

Modify Settings

Do the same exact procedure for EventID #27, but this time it will automate the enabling of the wifi adapter. Change the netsh.exe arguments to:
interface set interface "Wireless Network Connection" enable

I have done this tweak successfully on an older Lenovo T420, a Lenovo X240, a Dell D620 and an Elitebook 820. All I watched for were EventID #33 and EventID #27 on the System Event Logs. Yours may be different. The events for docking the notebooks differ by models. Those could be added as triggers.

You might also be interested in:


We at pimp-my-rig strive to keep on improving, help us reach that goal by leaving comments or constructive criticisms. Don't miss out on our next feature -- subscribe via RSS (What is RSS?).

Share This