Turn off Wifi if the PC is connected via Ethernet

We have said several times that the connection via ethernet cable is always preferable, if available, compared to a wifi connection, because it is more stable, theoretically faster (even if the difference is not visible) and also healthier, for those who believe that wifi can be unhealthy.
In a previous article, we saw how to force Windows to use the cable connection (faster) and not the wireless one, if the PC is connected to two connections.
In this case we see something different and perhaps more useful for those who, at home or in the office, can have both solutions available, both a wifi network and an ethernet cable connection.
Let's see, precisely, how to make sure that the wifi network card is automatically disabled by Windows if an active ethernet connection is detected .
The first way to do this is to use a specific network card setting if available.
Then click on the network icon near the clock with the right mouse button, open the Network Connection Center, press on Change tab settings on the left, right click on the Wifi connection, click on Properties and then on the Configure button below the name of the adapter.
In the window that opens, click on Advanced and look, in the various properties, if there is an entry with something like: Disable Upon Wired Connection .
If there is, select the property and then change the value in the menu next to putting it on Enabled or Enable .
This option ensures that the wifi card is disabled when the PC is connected to the LAN with the Ethernet cable .
If this option is not available, there is another way .
You need to install a Powershell script called the WLAN Manager, published on the Microsoft technet site.
Then download the WLAnManager.zip file and extract it to a folder.
Powershell is already included in Windows 8 and Windows 10 while it can be installed, if not present, in Windows 7.
For all the details, refer to the article on the difference between Powershell and the Command Prompt.
To install the script you need to open Powershell by finding it in the Start menu and starting it by pressing on it with the right button and clicking on Run as administrator .
Open the folder where the WLANManager.ps1 file is located, right click on the path of the folder at the top (under the View button), press Copy.
In Powershell, write cd, paste the path and press Enter .
We are in the folder where the ps1 file is located.
Now run the command:
set-executionpolicy remotesigned
This is to authorize the installation of external scripts and press T to confirm.
If that doesn't work, search for " Group Policy " from the Start menu and click on it.
Go to Computer Configuration> Administrative Templates> Windows Components> Windows Powershell> Enable scripting .
click on Activated and then, below, on Execution criteria select All scripts .
Press OK and then on Apply.
Finally, in Powershell, issue the command:
. \ WLANManager.ps1 -Install: System
Confirm twice by pressing the indicated key and install the script.
At this point, the wifi will be automatically disconnected when the PC connects to the internet via an ethernet cable and wakes up on its own when it disconnects .

Leave Your Comment

Please enter your comment!
Please enter your name here