The Issue
- By default, if your current WiFi network does not have a valid internet connection, Windows will disconnect and try another WiFi network.
- This is not roaming where your WiFi NIC tries to connect to the strongest AP of the same SSID.
- Change WiFi Roaming Sensitivity or Aggressiveness to improve Wi-Fi reception & performance | TheWindowsClub - We show you how to change Wi-Fi Roaming Aggressiveness or Sensitivity in Windows 11/10 to improve Wi-Fi reception & performance.
- Windows by design marks a Wi-Fi as “Limited” if it can’t reach the internet (via the Network Connectivity Status Indicator, NCSI check). When this happens, Windows may try to roam to another SSID that looks “better”, even if you want to stay put.
Cause
- This is a common situation. Most operating systems (Windows, macOS, Linux, Android, iOS) will automatically disconnect or deprioritise a Wi-Fi network if it doesn’t provide internet access.
- Windows in particular uses a NCSI probe by sending a packet to Microsoft and this requires a valid gateway to connect to the internet.
- Network Connectivity Status Indicator overview for Windows | Microsoft Learn - The Network Connectivity Status Indicator (NCSI) helps to detect network connectivity and troubleshoot via network probing and passive polling.
- No Internet Error on Windows - NCSI Troubleshooting - Cato Learning Centre
- Windows reports that there is no internet connectivity on the Ethernet or WiFi link even though the user can successfully access the Internet.
- If NCSI receives a valid response from a DNS server, NCSI sends a plain HTTP GET request to:
http://www.msftconnecttest.com/connecttest.txt
- The whole NCSI process is described here which can aid in troubleshooting.
- wireless networking - How does Windows know whether it has internet access or if a Wi-Fi connection requires in-browser authentication? - Super User
- Network Connectivity Status Indicator troubleshooting guide for Windows | Microsoft Learn - This guide demonstrates how to perform diagnostics using the Network Connectivity Status Indicator (NCSI) to troubleshoot and determine Internet connectivity.
Solutions
TL;DR
- Best solution if you want zero hassle: Disable NCSI probing (Method 5)
- The most reliable cross-platform trick is to assign a static IP configuration (with no gateway/DNS), so the OS doesn’t expect Internet routing from that Wi-Fi. That way it just treats it as a LAN.
- There isn’t a simple toggle in Windows to say “stay connected no matter what”, but in Windows 10/11, you can force the system to stay connected to one SSID even if it has no internet.
- You can stop that behaviour by using one of the methods below. Some methods prevent the switching of SSID while there are some scripts to constantently check the SSID and if it has changed will revert tot he correct SSID.
Method 1: Make the SSID your top priority & stop auto-switching
- Press Win + I → open Settings.
- Go to Network & Internet → Wi-Fi → Manage known networks.
- Click your target SSID → Properties.
- Turn On → “Connect automatically when in range.”
- Back in Wi-Fi settings, disable:
- Hotspot 2.0 networks (if you don’t use them).
- Connect to suggested open hotspots.
- Connect to networks shared by my contacts (on older Windows builds).
- Run this command in PowerShell (admin) to prevent Windows from switching away:
netsh wlan set profileparameter name="YourSSID" connectionmode=auto netsh wlan set profileparameter name="YourSSID" nonBroadcast=connect
(ReplaceYourSSID
with the exact Wi-Fi name.)
Method 2: Force Windows to always use that Wi-Fi (interface metric trick)
By default, Windows disconnects when a network has no valid gateway/internet. You can override that:
- Press Win + R, type
ncpa.cpl
, hit Enter. - Right-click your Wi-Fi adapter → Properties.
- Select Internet Protocol Version 4 (TCP/IPv4) → Properties → Advanced.
- At the bottom, uncheck Automatic metric, and set Interface metric = 1 (highest priority).
- This tells Windows: “always prefer this adapter, regardless of internet state.”
Optional: If you don’t need internet routing via this SSID (just local LAN), you can remove the Default Gateway entry in the IPv4 settings. That way, Windows won’t even expect internet, so it won’t try to drop it.
Method 3: Disable "Smart Disconnect"
Some Wi-Fi drivers (Intel, Realtek, Killer, etc.) have a feature that disconnects from networks without internet:
- Open Device Manager → expand Network adapters.
- Right-click your Wi-Fi adapter → Properties → Advanced tab.
- Look for options like Roaming Aggressiveness, Smart Disconnect, or Prefer Band.
- Set Roaming Aggressiveness = Lowest, and disable any “Smart Disconnect”/“Disconnect if no Internet” feature.
There isn’t a simple toggle in Windows to say “stay connected no matter what”, but there are a few reliable workarounds:
Method 4: Use a “No Internet” Profile
- In Network & Sharing Center, set a static IP on your Wi-Fi and leave the gateway blank.
- Without a gateway, Windows won’t expect internet and won’t mark it as “Limited.”
- It will stay connected as a pure LAN.
- The downside of this method is that you do not have internet when it is available and when you manually swap networks you might have to change you IP address.
Method 5: Disable the NCSI Internet connectivity check / Probe
This disables the Windows’ NCSI Internet connectivity check forcing Windows to always report “Connected” to your Wi-Fi, even if there’s no Internet so it will never get tagged as "Limited" and then be dropped. Windows will stop testing for internet access and this alone fixes the auto-disconnect in most cases.
- Press Win+R, type
regedit
, press Enter. - Navigate to:
HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\NlaSvc\Parameters\Internet
- Change these values (create them if missing):
EnableActiveProbing
→ set to0
(DWORD)
- Restart your computer.
Disable_NCSI.reg
Windows Registry Editor Version 5.00 [HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\NlaSvc\Parameters\Internet] "EnableActiveProbing"=dword:00000000
This makes Windows always report “Connected” regardless of Internet access.
Re-Enable_NCSI.reg
Windows Registry Editor Version 5.00 [HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\NlaSvc\Parameters\Internet] "EnableActiveProbing"=dword:00000001
Note: With NCSI disabled, Windows will always show “Connected” even if the network is offline. Apps that rely on NCSI (like the captive portal pop-up for hotel Wi-Fi) won’t launch automatically — you’ll need to open a browser manually in those cases.
Method 6: Use Third-Party Tools
If you want more control, a few small utilities exist that can “lock” Windows to a specific SSID:
- WLAN Manager (lightweight tool that lets you pin priority SSIDs and prevent roaming).
- NetSetMan (free for personal use; can lock profiles and prevent auto-switch).
- Wi-Fi Profile Manager 8 (open source, lets you enforce one SSID as top priority).
These basically override Windows’ automatic “choose a better network” logic.
Method 7: Disable "autoSwitch" for Wi-Fi networks (Windows 11)
This method requires manual intervention but can be useful in some setups.
- Turn On or Off AutoSwitch for Wi-Fi Network in Windows 11 | Windows 11 Forum
- This tutorial will show you how to turn on or off autoSwitch for Wi-Fi networks set to connect automatically when in range on your Windows 11 or Windows 10 PC.
- When you connect to a Wi-Fi network for the first time, Windows will automatically add a profile for the Wi-Fi network. The saved profile contains the SSID (network name), security key (password), and connection and security properties used to connect to this specific Wi-Fi network.
- If you turn on connect automatically to a Wi-Fi network, Windows will automatically connect to this Wi-Fi network when in range based on priority order.
- The autoSwitch parameter controls the roaming behavior of an auto-connected Wi-Fi network when a more preferred connect automatically Wi-Fi network is in range. If autoSwitch is turned on, it allows Windows to continue looking for other connect automatically Wi-Fi networks while connected to the current Wi-Fi network. If a higher priority connect automatically Wi-Fi network than the currently connected Wi-Fi network comes in range, Windows will automatically switch and connect to it instead.
Method 8: Scripted Auto-Reconnect
If you’re comfortable with PowerShell, you can make Windows automatically reconnect to your SSID even if it drops:
Option 1 - Background Scheduled Task
- This will run silently.
- This is to be run as a background scheduled task
- Every 10 seconds this script will check to make sure the Wifi is connected to the configured SSID, and if not, it will swap it back.
- This script does not prevent switching.
# Force Wi-Fi to stay connected to one SSID, even if disconnected $SSID = "YourSSID" while ($true) { $connected = (netsh wlan show interfaces) -match $SSID if (-not $connected) { netsh wlan connect name=$SSID } Start-Sleep -Seconds 10 }
- Replace
YourSSID
with your exact Wi-Fi name (SSID). - Save this as
ForceWiFi.ps1
- Run this as a background scheduled task
- Run Automatically at Startup
- Open Task Scheduler (Win+R →
taskschd.msc
). - Click Create Task.
- On the General tab:
- Name:
Force Wi-Fi Stay Connected
- Check Run with highest privileges.
- Name:
- On the Triggers tab:
- New → Begin the task: At log on.
- On the Actions tab:
- New → Action: Start a program
- Program/script:
powershell.exe
- Arguments:
-ExecutionPolicy Bypass -File "C:\Path\To\ForceWiFi.ps1"
- Save → Restart → it will auto-run in background.
- Open Task Scheduler (Win+R →
Option 2 - Manually run PowerShell Script (displays connection status)
- This will output the connection status to the screen on every cycle.
- You can easily stop this by closing the command window.
- Every 10 seconds this script will check to make sure the Wifi is connected to the configured SSID, and if not, it will swap it back.
- This script does not prevent switching.
# Force Wi-Fi to stay connected to one SSID, even if disconnected $SSID = "YourSSID" # <-- Replace with your Wi-Fi name while ($true) { $connected = (netsh wlan show interfaces) -match $SSID if (-not $connected) { Write-Output "[$(Get-Date -Format 'HH:mm:ss')] Not connected. Reconnecting to $SSID..." netsh wlan connect name="$SSID" } else { Write-Output "[$(Get-Date -Format 'HH:mm:ss')] Still connected to $SSID." } Start-Sleep -Seconds 10 }
- Replace
YourSSID
with your exact Wi-Fi name (SSID).
Method 9: Combined NCSI Probing and SSID Switcher
I have added this here just in-case I need to come up with a more streamlined solution.
This script will
- Applies the registry tweak (disables NCSI probing).
- Creates the PowerShell script in
C:\ForceWiFi\ForceWiFi.ps1
. - Registers a Task Scheduler job that runs it at login with highest privileges.
How to Use
- Copy the code into Notepad.
- Save as
ForceWiFiSetup.bat
(Save as type: All Files, not.txt
). - Right-click → Run as Administrator.
- Edit
C:\ForceWiFi\ForceWiFi.ps1
and changeYourSSID
to your actual Wi-Fi name. - Reboot.
After reboot:
- Windows will no longer drop your Wi-Fi just because it has no Internet.
- The scheduled task will always force reconnection to your chosen SSID in the background.
ForceWiFiSetup.bat (Installer)
Save this as ForceWiFiSetup.bat
(Right-click → Run as Administrator):
@echo off :: ===================================== :: Force Windows to stay connected to one SSID :: ===================================== :: --- Create folder for script mkdir "C:\ForceWiFi" >nul 2>&1 :: --- Create the PowerShell script echo # Force Wi-Fi to stay connected to one SSID, even if disconnected > C:\ForceWiFi\ForceWiFi.ps1 echo $SSID = "YourSSID" # <-- Replace with your Wi-Fi name >> C:\ForceWiFi\ForceWiFi.ps1 echo while ($true) { >> C:\ForceWiFi\ForceWiFi.ps1 echo $connected = (netsh wlan show interfaces) -match $SSID >> C:\ForceWiFi\ForceWiFi.ps1 echo if (-not $connected) { >> C:\ForceWiFi\ForceWiFi.ps1 echo Write-Output "[$(Get-Date -Format 'HH:mm:ss')] Not connected. Reconnecting to $SSID..." >> C:\ForceWiFi\ForceWiFi.ps1 echo netsh wlan connect name="$SSID" >> C:\ForceWiFi\ForceWiFi.ps1 echo } else { >> C:\ForceWiFi\ForceWiFi.ps1 echo Write-Output "[$(Get-Date -Format 'HH:mm:ss')] Still connected to $SSID." >> C:\ForceWiFi\ForceWiFi.ps1 echo } >> C:\ForceWiFi\ForceWiFi.ps1 echo Start-Sleep -Seconds 10 >> C:\ForceWiFi\ForceWiFi.ps1 echo } >> C:\ForceWiFi\ForceWiFi.ps1 :: --- Disable NCSI Active Probing in registry reg add "HKLM\SYSTEM\CurrentControlSet\Services\NlaSvc\Parameters\Internet" /v EnableActiveProbing /t REG_DWORD /d 0 /f :: --- Register scheduled task schtasks /create /tn "ForceWiFiStayConnected" /tr "powershell.exe -ExecutionPolicy Bypass -File C:\ForceWiFi\ForceWiFi.ps1" /sc onlogon /rl highest /f echo. echo ===================================== echo Setup complete! echo - Replace YourSSID in C:\ForceWiFi\ForceWiFi.ps1 with your Wi-Fi name echo - Restart your computer for registry change to take effect echo ===================================== pause
ForceWiFiRemove.bat (Uninstaller)
Save this as ForceWiFiRemove.bat
(Right-click → Run as Administrator):
@echo off :: ===================================== :: Remove ForceWiFi setup (script + registry + scheduled task) :: ===================================== :: --- Delete the PowerShell script folder if exist "C:\ForceWiFi" ( rmdir /s /q "C:\ForceWiFi" echo Removed C:\ForceWiFi folder. ) else ( echo No C:\ForceWiFi folder found. ) :: --- Re-enable NCSI Active Probing reg add "HKLM\SYSTEM\CurrentControlSet\Services\NlaSvc\Parameters\Internet" /v EnableActiveProbing /t REG_DWORD /d 1 /f echo Re-enabled Windows Internet connectivity check (NCSI). :: --- Delete scheduled task schtasks /delete /tn "ForceWiFiStayConnected" /f echo Removed scheduled task ForceWiFiStayConnected. echo. echo ===================================== echo Cleanup complete! echo - NCSI probing restored echo - Scheduled task removed echo - Script folder deleted echo ===================================== pause