You are here:Home»KB»PC»Windows Family»Windows General»Windows changes the WiFi Network when it has no Internet Connection
Friday, 22 August 2025 14:45

Windows changes the WiFi Network when it has no Internet Connection

Written by

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.
  • 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

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

  1. Press Win + I → open Settings.
  2. Go to Network & Internet → Wi-Fi → Manage known networks.
  3. Click your target SSID → Properties.
    • Turn On → “Connect automatically when in range.”
  4. 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).
  5. 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
    (Replace YourSSID 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:

  1. Press Win + R, type ncpa.cpl, hit Enter.
  2. Right-click your Wi-Fi adapter → Properties.
  3. Select Internet Protocol Version 4 (TCP/IPv4) → Properties → Advanced.
  4. 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:

  1. Open Device Manager → expand Network adapters.
  2. Right-click your Wi-Fi adapter → Properties → Advanced tab.
  3. Look for options like Roaming Aggressiveness, Smart Disconnect, or Prefer Band.
  4. 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.

  1. Press Win+R, type regedit, press Enter.
  2. Navigate to:
    HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\NlaSvc\Parameters\Internet
  3. Change these values (create them if missing):
    • EnableActiveProbing → set to 0 (DWORD)
  4. 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:

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.
    • 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.

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

  1. Applies the registry tweak (disables NCSI probing).
  2. Creates the PowerShell script in C:\ForceWiFi\ForceWiFi.ps1.
  3. Registers a Task Scheduler job that runs it at login with highest privileges.

How to Use

  1. Copy the code into Notepad.
  2. Save as ForceWiFiSetup.bat (Save as type: All Files, not .txt).
  3. Right-click → Run as Administrator.
  4. Edit C:\ForceWiFi\ForceWiFi.ps1 and change YourSSID to your actual Wi-Fi name.
  5. 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

 

Read 18 times Last modified on Saturday, 23 August 2025 11:38