4 Ways to Automatically Disable Wireless Network Connection when Local Area Connection is Enabled

These days a wireless internet connection (WiFi) is the standard way for laptops, netbooks and even desktops to connect to the internet in the event an Ethernet connection isn’t available. It’s quite obvious that most of the time a direct cable connection to the router is going to be faster than via wireless, so it’s a good idea to plug in a network cable if one is close at hand. One of the problems with enabling an Ethernet connection while on WiFi is that many computers will continue to use the WiFi connection unless you disconnect or disable it manually which isn’t terribly efficient.

Although Windows is often smart enough to prioritize and set the wired connection above the WiFi, sometimes it isn’t and even manually setting the network priority yourself doesn’t always work. If the wireless connection is not in use, it makes sense to disable it until needed again, not only to avoid any possible routing issues, but it might also save a little bit of battery life as well. If you find yourself sometimes having to switch between WiFi and Ethernet connections but think it’s a hassle to manually disable or enable the devices, here are 4 ways you can do it automatically. 1. Using a Visual Basic Script

Steve Wiseman from IntelliAdmin has written a Visual Basic script that automatically disables the wireless adapter when Ethernet is available and vice versa. First you need to identify the names of the connections used by Ethernet and WiFi, go to Control Panel -> Network and Sharing Center -> Change adapter settings, and make a note if the names are different from the defaults below.

Network Connection Name

Once you’ve identified both the LAN and WiFi connection name, download the correct NetSwitch vbscript file according to your Windows operating system from the links below. Then rename the file extension from .dat to .vbs (e.g; NetSwitch.vbs).

NetSwitch.dat for Windows 2003, Vista, 7, and 2008
NetSwitchXP.dat for Windows XP

To put the wired connection as first priority and the wireless connection as secondary, type the following command at the Command Prompt. This means that whenever the wired network connection is connected, the vbscript will automatically disable the wireless connection. If the wired network connection is unavailable, the vbscript will then fallback to and enable the wireless connection.

NetSwitch.vbs “Local Area Connection” “Wireless Network Connection”

Netswitch Command Line

This script requires administrator privileges to run. If you want to start the script with Windows, the easiest way to do it is create a shortcut of the the script, right click on it -> Properties and append the “Local Area Connection” “Wireless Network Connection” arguments in the Target box. Then place the shortcut into the Startup folder.


2. Lenovo ThinkVantage Access Connections

A lot of laptop software installed by the manufacturers can include some form of wireless connection monitor which may include the switching option, so it’s worth checking the documentation. What makes the Lenovo Thinkvantage software more special is it seems to work on just about all laptops and WiFI adapters, not just those from Lenovo. It’s a pretty hefty download of 25-40MB depending on the version of Windows, but if you like a program with a smart interfaces, you’ll love ThinkVantage Access Connections.

ThinkVantage Access Connections

Setting it up is a little bit of a bind, here’s how:

1. During install you will be asked which connections are to be supported by the program, it’s advisable to only click what you require. After installing and a reboot, you will be asked for an Ethernet location name, click Cancel.

2. On the task bar you’ll see a new network icon which will open the main interface if you click on it. Click Create to make a new Profile and then give it a name. The network connection should be set to Best Available already, the wireless and wired adapters should be selected and you can set a few options such as Ethernet duplex and Wake-on-Lan if you know what they do. Click Next.

Access Connections Create New Profile

3. Because ThinkVantage Access Connections will take over your WiFi connection you need to manually enter your wireless settings such as SSID and security type/password. Click Next.

4. On the next window you can setup some more complex options like connection sharing, override TCP/IP settings, Enable a VPN connection, and set a new default home page and proxy. Unless you specifically want to change the settings, leave them alone and click Finish and then Yes to apply the profile. Close the program interface.

Now you can switch between Ethernet and WiFi, the wireless adapter doesn’t actually completely disable but instead the WiFi’s radio is turned off which is similar to what most laptop wireless Fn+hotkey combinations do. ThinkVantage Access Connections also has an option available to setup a wireless hotspot for other wireless devices to connect to. We tried the program on 3 or 4 non Lenovo laptops that didn’t have wireless adapters on the supported list, and they all worked fine. There are separate versions of the program for Windows XP, Vista and Windows 7.

Download ThinkVantage Access Connections For XP | For Vista | For 7


3. BridgeChecker

Unfortunately BridgeChecker is shareware these days, but there’s still an older free version from 2009 on the internet. It does have a drawback though of not working properly on a 64-bit Windows so is recommended for 32-bit systems only. Although it isn’t, the program looks and acts a little bit like a frontend for the vbscript above but with a couple of extra options.

When you start BridgeChecker it goes straight to the system tray, right click the icon to open it and you will be asked for a password which can be custom configured later on, the current default is 123. In the main window select the Primary adapter from the drop down which will have priority over the Secondary adapter you select below it. There are extra options to choose whether to disable the second adapter or not and what to do when the Primary adapter disconnects.

BridgeChecker

Rather oddly there is no option within BridgeChecker to start the program with Windows so you will have to drop the shortcut into your Startup folder. Although it seemed to work fine in Windows 7 32-bit and enables/disables the WiFi on command, we did observe a few moments where BridgeChecker seemed to be causing an increase in CPU usage while running, killing its processes stopped this. We can’t be sure whether this is a common problem or a local issue on our test laptop.

Download BridgeChecker 1.2 (via Softpedia)

The fourth and final method of wireless/LAN switching on page 2 is perhaps the most interesting because it requires no extra software, and is currently the preferred method we use on a few of our laptops.

4. Create a Scheduled Task to Auto Switch

Using this method relies on your computer’s LAN adapter sending an event to the Windows Event Viewer when it disconnects and reconnects. With this information you can then create tasks to disable or re-enable the Wifi adapter depending on the connection status of the wired connection. This does not work on Windows XP because it doesn’t have the option to trigger a task when a specific event is logged.

1. Go to Control Panel -> Administrative Tools -> Event Viewer. When Event Viewer is open, go to Windows Logs -> System.

2. Disconnect and reconnect your Ethernet cable a few times to generate some events. Press F5 to refresh the window and click on the newest events, hopefully you will find a “Port is up”, “link up” or similar description in the lower General tab to indicate the LAN has connected, and another one when the LAN was disconnected.

Event Viewer Port is Up

3. Make a note of the name in the Source column and the Event ID for the connect and disconnect events you found. On our Dell laptop we got a connect Event ID of 121 and disconnect of 83 with the Source name of “yukonw7”, yours will likely be different though. If you can only find a Source event for Services Control Manager and not one that looks like the LAN adapter name, this method will not work because an event needs to be generated by the Ethernet adapter itself.

Event Viewer Source
4. Go to Control Panel -> Administrative Tools -> Task Scheduler, then click on Task Scheduler Library -> Create Basic Task.

5. Give the Task a name, such as “Undock Laptop” or “Switch to Wifi” etc. Click Next, select “When a specific event is logged”, and click Next again.

Create Basic Task Wizard

6. In the Log drop down select System, find the source name from step 3 in the drop down list or type it in, then enter the Event ID for the disconnect event. Click Next, make sure Start a program is selected, click Next again.

When an event is logged

7. In the Program/script box enter C:\Windows\System32\Netsh.exe or browse for it. Enter the following into the Add arguments box:

interface set interface “Wireless Network Connection” enable

This is assuming your WiFi connection is called “Wireless Network Connection”. To check go to Control Panel -> Network and Sharing Center -> Change adapter settings, and change the name if it’s different. Click Next, review the task making sure it’s correct, then click Finish.

Start a program

8. Now you have a task that enables the WiFi on a LAN disconnect, you obviously have to do the opposite to disable the WiFi on LAN reconnect. Repeat steps 4 – 7 again, but change the name in step 5 to “Dock Laptop” or “Switch to LAN” etc, enter the connect Event ID in step 6, and on the argument line in step 7, swap the word enable for disable.

Task Scheduler

Open the Network Connections window and you should notice the wireless connection disable itself when the Ethernet cable is inserted and vice versa. This worked flawlessly on our Dell laptops, but didn’t work on an older MSI laptop because it wouldn’t generate a specific event on connecting/disconnecting the Ethernet cable.

13 Comments - Write a Comment

  1. David Whyte 9 months ago
  2. Paweł Szczeciński 10 months ago
  3. Eric 10 months ago
  4. jw 10 months ago
  5. Shivaraj Dalawai 1 year ago
  6. Chris 1 year ago
    • Evan Sullivan 1 year ago
  7. Getafix, the Druid 3 years ago
  8. beetlejuice 3 years ago
  9. beetlejuice 3 years ago
  10. musubi 3 years ago
    • SystemAccount 3 years ago
  11. V Vivekanand 6 years ago

Leave a Reply

Your email address will not be published. Required fields are marked *

Note: Your comment is subject to approval. Read our Terms of Use. If you are seeking additional information on this article, please ask in our forum or contact us directly.