Solved Windows 11 Pro network selection


Hollywood

Well-known member
Member
Local time
4:09 PM
Posts
233
OS
Windows 11
Hi,

I have an ethernet connection to my computer as well as several wifi access point SSIDs that I use for different purposes.

When the network cable is plugged in, the PC defaults to that internet connection. There is a (best guess description) terminal icon in the tray. I can click on it and it brings up the dialog with wifi and sound, etc. I can choose a wifi, but the PC seems to stay on the ethernet connection as reflected by the tray icon. If I go to Settings, Network, and disable the ethernet adapter, the wifi that I selected takes over and is correctly reflected on the tray icon.

Is there an easier way to switch between a wired connection and a wifi (and visa-versa) without having do disable the adapter?

Thanks!
 

My Computer My Computer

At a glance

Windows 11
OS
Windows 11

 

My Computer My Computer

At a glance

Windows 11 Pro
OS
Windows 11 Pro
Thanks for your reply. I read the thread and I'm not sure it is the solution, and even so, replies further down have members complaining it no longer works.

I am not necessarily wanting to change the default priority. I actually want the wired connection to be the default, but I am trying to be able to choose a wifi network and just go to it.

The fact that I can be on ethernet and go to the wifi dialog and (actually) connect to a wifi network seems like it should just do that, and switch to your choice. There is no reason it shouldn't and I consider this to be a bug.

All of the wifi choices listed have a Disconnect button, but not the wired connection (except through the settings). If you choose a different SSID, it automatically connects to the new choice and disconnects the previous one automatically. Basically I am looking for a similar method that includes the wifi and ethernet choices.

You guys are awesome here. I don't know if I will find the answer, but if it's possible, someone here will solve it. :-)

Thanks again
 

My Computer My Computer

At a glance

Windows 11
OS
Windows 11
Windows now ignores the metric, so you cannot set WiFi above Ethernet in the priority list. That drives me nuts because with WiFi 7 my systems are actually way faster on WiFi than on gigabit Ethernet, so I had to switch to 2.5Gb Ethernet although it's really no faster than the WiFi.
 

My Computers My Computers

  • At a glance

    Win11 Pro 25H2 (RTM+)Intel i7-14650HX32 GBNo GPU - Built-in Intel Graphics
    OS
    Win11 Pro 25H2 (RTM+)
    Computer type
    PC/Desktop
    Manufacturer/Model
    Acemagic
    CPU
    Intel i7-14650HX
    Memory
    32 GB
    Graphics Card(s)
    No GPU - Built-in Intel Graphics
    Sound Card
    Integrated
    Monitor(s) Displays
    Varies as machine will often be moved to locations with different monitors
    Screen Resolution
    Varies
    Hard Drives
    1 x 1TB Gen 4 NVMe SSD
    PSU
    120W Power Brick
    Keyboard
    Corsair K70 Max RGB Magnetic Keyboard
    Mouse
    Logitech MX Master 3
    Internet Speed
    1Gb Up / 1 Gb Down
    Browser
    Edge
    Antivirus
    Windows Defender
  • At a glance

    Win11 Pro 25H2 (RTM+)Intel i7-1255U16 GBIntel Iris Xe Graphics
    Operating System
    Win11 Pro 25H2 (RTM+)
    Computer type
    Laptop
    Manufacturer/Model
    Lenovo ThinkBook 13x Gen 2
    CPU
    Intel i7-1255U
    Memory
    16 GB
    Graphics card(s)
    Intel Iris Xe Graphics
    Sound Card
    Realtek® ALC3306-CG codec
    Monitor(s) Displays
    13.3-inch IPS Display
    Screen Resolution
    WQXGA (2560 x 1600)
    Hard Drives
    2 TB 4 x 4 NVMe SSD
    PSU
    USB-C / Thunderbolt 4 Power / Charging
    Keyboard
    Backlit, spill resistant keyboard
    Mouse
    Buttonless Glass Precision Touchpad
    Internet Speed
    1Gb Up / 1Gb Down
    Browser
    Edge
    Antivirus
    Windows Defender
    Other Info
    WiFi 6e / Bluetooth 5.1 / Facial Recognition / Fingerprint Sensor / ToF (Time of Flight) Human Presence Sensor
The first tutorial I linked was because you can set Wi-Fi as priority over Ethernet, then set your Wi-Fi to not auto connect. So when you toggle off Wi-Fi, Ethernet will connect default and to connect Wi-Fi over Ethernet without disabling the adapter, just choose your saved Wi-Fi from the list of networks and click connect
 

My Computer My Computer

At a glance

Windows 11 Pro
OS
Windows 11 Pro
Windows now ignores the metric, so you cannot set WiFi above Ethernet in the priority list.
that's what the other posters were also reporting.
 

My Computer My Computer

At a glance

Windows 11
OS
Windows 11

My Computer My Computer

At a glance

Windows 11 Pro
OS
Windows 11 Pro
The first tutorial I linked was because you can set Wi-Fi as priority over Ethernet, then set your Wi-Fi to not auto connect. So when you toggle off Wi-Fi, Ethernet will connect default and to connect Wi-Fi over Ethernet without disabling the adapter, just choose your saved Wi-Fi from the list of networks and click connect
Wow, forward thinking! :-)
First, will this still work? Second, when you choose a wifi (and it shows Connected), will it be the network or would it still stay on the ethernet connection?

The tutorial has many steps, and I am slow to follow new stuff. I will invest the time if you think it will work, but am just wondering...

Thanks!
 

My Computer My Computer

At a glance

Windows 11
OS
Windows 11
Wow, forward thinking! :-)
First, will this still work? Second, when you choose a wifi (and it shows Connected), will it be the network or would it still stay on the ethernet connection?

The tutorial has many steps, and I am slow to follow new stuff. I will invest the time if you think it will work, but am just wondering...

Thanks!
It will work, but @hsehestedt stated it will no longer set the Wi-Fi priority over Ethernet. That’s what I was referring to about writing a script to do.

It would be the Wi-Fi over Ethernet. Example:

Ethernet plugged in
Delete all known Wi-Fi networks
Connect to each Wi-Fi, one at a time and set each to Not auto connect

  • CTRL+A to open control center
  • Turn off wifi
  • Ethernet will be connected
  • When Wi-Fi needed, CTRL+A and enable Wi-Fi > choose desired network > connect
  • Wi-Fi will be connected, taking priority over Ethernet
 

My Computer My Computer

At a glance

Windows 11 Pro
OS
Windows 11 Pro
That’s what I was referring to about writing a script to do.
I assume the script would auto start in task scheduler and do all the stuff you listed? If so, I would appreciate you doing so if it is not too much trouble. I think others would also like a better way to switch networks too.

Thanks you!
 

My Computer My Computer

At a glance

Windows 11
OS
Windows 11
I assume the script would auto start in task scheduler and do all the stuff you listed? If so, I would appreciate you doing so if it is not too much trouble. I think others would also like a better way to switch networks too.

Thanks you!
I’ll get one written
 

My Computer My Computer

At a glance

Windows 11 Pro
OS
Windows 11 Pro
I’ll get one written
no rush. I am working on my network rack and am making great progress but still have some more to go to keep me busy. My goal is privacy and security. I will have a few vlans and SSIDs so your help will make using my computer easier to switch to a VPN SSID or a different country.

Thanks for your help!
 

My Computer My Computer

At a glance

Windows 11
OS
Windows 11
no rush. I am working on my network rack and am making great progress but still have some more to go to keep me busy. My goal is privacy and security. I will have a few vlans and SSIDs so your help will make using my computer easier to switch to a VPN SSID or a different country.

Thanks for your help!
so 2 things:

i tested on a 25H2 and ran these commands in PowerShell as Admin:

Code:
Set-NetIPInterface -InterfaceAlias "Wi-Fi" -InterfaceMetric 10
Code:
Set-NetIPInterface -InterfaceAlias "Local Area Connection* 1" -InterfaceMetric 50
Code:
Set-NetIPInterface -InterfaceAlias "Local Area Connection* 2" -InterfaceMetric 50

then checked to see if Wi-Fi was set to a priority over Ethernet via:

PowerShell as Admin (you can cancel the tracert after a handful of hops - CTRL+C):
Code:
tracert google.com
Code:
Get-NetRoute | Sort-Object RouteMetric | Select-Object -First 10

this 100% output that metic 10 (Wi-Fi) was the priority over 25 (Ethernet) and Windows recognized it...

but here is an ahk script to do just that. it runs in the tray and checks/applies that every 10 seconds

Code:
#Persistent
SetTimer, SetAdapterPriority, 10000

SetAdapterPriority:
Run, powershell -Command "Set-NetIPInterface -InterfaceAlias 'Wi-Fi' -InterfaceMetric 10; Set-NetIPInterface -InterfaceAlias 'Ethernet' -InterfaceMetric 50", , Hide
Return

*compiled .exe is attached as .zip, but it is compiled with the code using 'Wi-Fi' and "Ethernet' as the adapter names. if yours is the same it'll work. if not i'll have to recompile one for you with the proper names in it, unless you want to 1) compile it yourself using the script or 2) change your adapter names to match.
 

Attachments

My Computer My Computer

At a glance

Windows 11 Pro
OS
Windows 11 Pro
@dacrone You can get the wireless adapters with

Powershell:
Get-CimInstance -Namespace 'root\wmi' -ClassName 'MSNdis_PhysicalMediumType' | Where-Object { $_.NdisPhysicalMediumType -eq 9 }

and then match up the InstanceName from that with the InterfaceDescription from Get-NetAdapter.

Edit: Actually Get-NetAdapter already has this.... Get-NetAdapter | ? { $_.NdisPhysicalMedium -eq 9 }
 

My Computer My Computer

At a glance

Windows 11 Enterprise 25H2 [rev. 8893]
OS
Windows 11 Enterprise 25H2 [rev. 8893]
*compiled .exe is attached as .zip, but it is compiled with the code using 'Wi-Fi' and "Ethernet' as the adapter names. if yours is the same it'll work. if not i'll have to recompile one for you with the proper names in it, unless you want to 1) compile it yourself using the script or 2) change your adapter names to match.
Thank you very much. I am in the middle of rebuilding my network, so some things don't work at the moment. I wanted to be sure of the original (choosing) network behavior so I chose an SSID and when it connected, it showed the wifi icon in the tray. That is not what happened yesterday when I wrote that the wifi connected, but the tray icon still showed ethernet.

i did run your script and am not sure if it made a permanent change, but my network selection is actually how I want it, even after a reboot. I am going in several different directions right now due to my project. I even reset my router to default to try and solve other issues. I will confirm this after I resetup my VPN router to see if it shows my location on the (out of the country) server I selected.

Side note: most of my wired devices are working properly, LMS music server, Tablo DVR, VOIP adapter, and NAS, but not my surveillance cameras NVR. This worked with my Asus router, and still does after retrying it to test it. I can not get it to show on mt TP-Link router's client list. I set it's mac address for a static IP, and it now shows up when I run Advanced IP Scanner, but still not on the TP-Link router client list. I'm not asking for help with this here, I'm just explaining what is consuming my time until I get that sorted out. Perhaps I will make a new thread if I don't have any luck soon.

anyway... Thanks again for making the script and I will let you know how the switching goes when I am sure my setup is all working properly.
 

My Computer My Computer

At a glance

Windows 11
OS
Windows 11
I chose an SSID and when it connected, it showed the wifi icon in the tray. That is not what happened yesterday when I wrote that the wifi connected, but the tray icon still showed ethernet.

Side note: most of my wired devices are working properly, LMS music server, Tablo DVR, VOIP adapter, and NAS, but not my surveillance cameras NVR. This worked with my Asus router, and still does after retrying it to test it. I can not get it to show on mt TP-Link router's client list. I set it's mac address for a static IP, and it now shows up when I run Advanced IP Scanner, but still not on the TP-Link router client list. I'm not asking for help with this here, I'm just explaining what is consuming my time until I get that sorted out. Perhaps I will make a new thread if I don't have any luck soon.
Update... It seems everything gives me trouble at some point. :-)

I mentioned that the choosing network seemed to be working as I wanted. I have 2 routers used as access points both with different subnets. If I enter their ip into a browser, it will only connect to the settings page if I am on that wifi (as it should).

My issue yesterday was that was that when I choose a wifi SSID, it connected, but the tray still showed the ethernet icon. That was my issue. I said above that is was not the case today. Well.... that is sorta correct. I have three i9 miniPCs that all run 25H2. This issue with the ethernet icon not changing to wifi still happens on 2 of the PCs, but not on this one in my up stairs office. All seem to work properly, but it *appears* to be just the icon bot changing.

As far as my Lorex NVR issue, I did do everything right. It would not appear on the router client list unless I assigned a static IP. As it turned out that Ip was assign with DCHP to another device that was not on at the time. I deleted the saved DCHP entry and all works fine now.

@

dacrone I did run your script on this computer. Did it change settings because I rebooted and did not run it again. Is your script what fixed my issue, or was it designed to always run and process new network changes as they come.​


Thanks again for all of your help!
 

My Computer My Computer

At a glance

Windows 11
OS
Windows 11
Pretty good reason to have your static IPs, reserved IPs, and DHCP clients all in different parts of the range.
 

My Computer My Computer

At a glance

Windows 11 Enterprise 25H2 [rev. 8893]
OS
Windows 11 Enterprise 25H2 [rev. 8893]
Pretty good reason to have your static IPs, reserved IPs, and DHCP clients all in different parts of the range.
Yes, I reserved the 1st 100, but I have a lot of wifi smart devices that got picked up before I got into the settings.
Thanks.
 

My Computer My Computer

At a glance

Windows 11
OS
Windows 11
No, right, you probably know what you're doing based on what you've already said. It was more of a general comment for anyone reading this later.

I did a similar thing a couple of months ago. I was testing some file sharing stuff, and I had a VM with a certain name. After a while, I deleted that VM and made a new one. New VM means new MAC, so it grabbed a different IP address. My PC still had the old info cached, so that was a fun few minutes of WTFing.
 

My Computer My Computer

At a glance

Windows 11 Enterprise 25H2 [rev. 8893]
OS
Windows 11 Enterprise 25H2 [rev. 8893]
No, right, you probably know what you're doing based on what you've already said. It was more of a general comment for anyone reading this later.

I did a similar thing a couple of months ago. I was testing some file sharing stuff, and I had a VM with a certain name. After a while, I deleted that VM and made a new one. New VM means new MAC, so it grabbed a different IP address. My PC still had the old info cached, so that was a fun few minutes of WTFing.
first off, NO ONE ever accused me of knowing what I am doing! :-)

I am totally punting and learning as I go. For some stuff, youtube helped me, but recently I started googling specific questions and their AI answered most of them in a very helpful way. I don't know how long this has been there, but I am really progressing faster as I can find solutions with their AI. I guess my wording is ok because about 98% it helps me!

The situation you posted is typical of the stuff I see at least once a day. But I am learning and that's a good thing.
 

My Computer My Computer

At a glance

Windows 11
OS
Windows 11
Back
Top Bottom