How do I change the order of WiFi Networks in Windows 8.1 to give priority to one over another?
Solution 1:
Windows 8 lacks a GUI way to do this which is unfortunate.
-
At an elevated (admin) command prompt run the following command to see the available wireless networks and their current priorities:
netsh wlan show profiles
-
Note the name of the interface and the wireless network and use the following command to change the latter's priority:
netsh wlan set profileorder name="w1r3l3$$" interface="Wi-Fi" priority=1
Running
netsh wlan show profiles
again will show you the changed order.
Source
Naturally people have made GUIs to overcome this ridiculous omission, so you can use something like WiFi Profile Manager 8 instead:
Solution 2:
I wrote a script to allow users to edit this using notepad:
# Prioritize WLAN networks
# Prepare the temporary file
$tempfile = "$($Env:Temp)\wifiprio.txt"
Set-Content -Path $tempfile -encoding UTF8 @"
# Edit (re-arrange) the list of networks, putting the highest priority at the top.
# Empty lines and lines starting with # will be ignored.
#
"@
# Add the network list to the file
& netsh wlan show profiles | Where-Object {$_ -match(":")} | ForEach-Object {(($_.split(":"))[1]).trim()} | Out-File $tempfile -encoding UTF8 -Append
# Allow the user to edit the list
Start-Process -FilePath "notepad.exe" -ArgumentList $tempfile -PassThru -Wait
# Get the edited list
$networks = Get-Content $tempfile | Where-Object {$_ -notmatch "^\s*#"} | Where-Object {$_ -notmatch "^\s*$"}
# Clean up
Remove-Item $tempfile
# Set priority according to the edited list
$priority = 1
ForEach ($network in $networks)
{
& netsh wlan set profileorder name="$($network)" interface="Wi-Fi" priority=$priority
$priority += 1
}