Article View: alt.comp.os.windows-10
Article #138Re: Tip: full network reset
From: T
Date: Sun, 11 Oct 2026 08:53
Date: Sun, 11 Oct 2026 08:53
164 lines
7060 bytes
7060 bytes
On 10/10/26 10:47 AM, Maria Sophia wrote:
>
>> I was remoted into a customer and did something stupid.
>>
>> What did I do??? I ain't tellin'! ������
>>
>> Needless to say, I had to coach the customer over the
>> phone through a full network reset:
>>
>>
>> <Network.Reset.Full.Nuke.txt>
>> Windows 10/11 Full Network Reset:
>>
>> GUI:
>> --> Click Start
>> --> Settings.
>> --> Network & Internet.
>>
>> Windows 11: Click Advanced network settings → Network reset.
>> Windows 10: Click Status → Network reset.
>>
>> --> Click Reset now.
>> --> Confirm Yes if prompted.
>> The PC will restart automatically (or do a manual restart).
>>
>>
>> Admin CMD:
>> netsh int ip reset
>> netsh winsock reset
>> ipconfig /flushdns
>> shutdown /r /f /t 00
>>
>> Note: Save any open work before running the final command;
>> /f force-closes applications.
>> </Network.Reset.Full.Nuke.txt>
>>
>>
>> HTH someone else,
>> -T
>
> Whenever I screw up the network, I run this to reset Wi-Fi/Ethernet.
>
> @echo off
> REM This is v1p6 of C:\data\sys\batch\netconnect.bat
> REM Resets Wi-Fi to a consistent state after unexpected loss
> REM v1p0 20251029
> REM elevates to admin
> REM toggles Wi-Fi to put it into a consistent state after reboot
> REM then connects to a given named SSID
> REM v1p1 20251101
> REM added conditional checks and retries
> REM v1p2 20251102
> REM added loop to verify State/SSID and retry until truly connected
> REM v1p3 20251213
> REM added immediate Wi-Fi environment scan after successful connection
> REM v1p4 20251213
> REM outputs and overwrites log of the wrong name (no timestamp)
> REM in the wrong directory (it should be in the log directory!)
> REM v1p5 20251213
> REM outputs timestamped log file in the log directory
> REM v1p6 20251213
> REM WIP added logging of nearby cached access points after connection
>
> :: --- Elevate to admin if not already ---
> >nul 2>&1 net session
> if %errorlevel% neq 0 (
> echo Requesting administrative privileges...
> powershell -Command "Start-Process '%~f0' -Verb RunAs"
> exit /b
> )
>
> :: Use "netsh interface show interface" to get adapter name
> set adapter=Wi-Fi
> :: Assumption is that the ssid:password has already been saved
> set ssid=nordstrom.office_nomap
>
> :: The saved SSID profile is used for credentials.
> echo [%date% %time%] Toggling Wi-Fi adapter...
> netsh interface show interface name=%adapter%
>
> REM Disable the adapter (to set to a consistent state)
> netsh interface set interface name=%adapter% admin=disable
> timeout /t 5 >nul
>
> REM Enable the adapter (to set to the desired state)
> netsh interface set interface name=%adapter% admin=enable
> timeout /t 10 >nul
>
> echo Attempting to connect to %ssid%...
>
> REM Connect to the specified SSID after adapter is fully enabled
> powershell -Command "Enable-NetAdapter -Name '%adapter%' -Confirm:$false"
> timeout /t 5 >nul
>
> REM Added loop to verify State/SSID and retry until truly connected
> set retries=3
> :retry
> echo Connecting to %ssid%...
> netsh wlan connect name=%ssid%
> timeout /t 5 >nul
>
> for /f "tokens=2 delims=:" %%A in ('netsh wlan show interfaces ^| findstr /C:"State"') do (
> set state=%%A
> )
> for /f "tokens=2 delims=:" %%A in ('netsh wlan show interfaces ^| findstr /C:"SSID" ^| findstr /V "BSSID"') do (
> set currentSSID=%%A
> )
>
> set "state=%state: =%"
> set "currentSSID=%currentSSID: =%"
>
> REM Define log directory and ensure it exists
> set "logdir=C:\data\sys\log"
> if not exist "%logdir%" mkdir "%logdir%"
>
> REM Build timestamp for filename using WMIC (locale-independent)
> for /f %%A in ('wmic os get localdatetime ^| find "."') do set dt=%%A
> set "ts=%dt:~0,8%_%dt:~8,6%"
>
> REM Define logfile path with timestamp
> set "logfile=%logdir%\wifiscan_%ts%.log"
>
> REM Always create logfile entry, regardless of connection state
> echo === Run at %date% %time% === >> "%logfile%"
> echo Target SSID: %ssid% >> "%logfile%"
> echo State=[%state%] CurrentSSID=[%currentSSID%] >> "%logfile%"
>
> if /I "%state: =%"=="connected" (
> echo Connected (state=connected). Target SSID: %ssid%
> >> "%logfile%" echo Nearby Wi-Fi environment after connect:
> netsh wlan show networks mode=bssid >> "%logfile%"
> echo Wi-Fi environment snapshot saved to %logfile%
> goto done
> ) else (
> set /a retries-=1
> if %retries% gtr 0 (
> echo Not connected yet. Retrying...
> timeout /t 5 >nul
> goto retry
> ) else (
> echo Connection failed after multiple attempts.
> >> "%logfile%" echo Connection failed after multiple attempts.
> )
> )
>
>
> :done
>
> echo [%date% %time%] Done. Check your connection status.
> echo Final adapter status:
> netsh interface show interface name=%adapter%
> netsh wlan show interfaces
>
> REM Show the log contents in the console
> type "%logfile%"
>
> REM Open the log file with the default associated editor (gVim in your setup)
> start "" "%logfile%"
>
> pause
> :: end of C:\data\sys\batch\netconnect.bat
>
¡Ay, caramba!
Technical Details
Message-ID:
<11afipr$2fq2n$1@dont-email.me>Path:
mbox-mo1.pugleaf.net!archive.usenet.blueworldhosting.com!usenet.blueworldhosting.com!diablo1.usenet.blueworldhosting.com!eternal-september.org!feeder.eternal-september.org!nntp.eternal-september.org!.POSTED!not-for-mailReferences:
<11ad9na$1mp2o$1@dont-email.me> <11adtmo$q4e$1@nnrp.usenet.blueworldhosting.com>Show Full Headers
Complete Article Headers
Path: mbox-mo1.pugleaf.net!archive.usenet.blueworldhosting.com!usenet.blueworldhosting.com!diablo1.usenet.blueworldhosting.com!eternal-september.org!feeder.eternal-september.org!nntp.eternal-september.org!.POSTED!not-for-mail From: T <T@invalid.invalid> Newsgroups: alt.comp.os.windows-11,alt.comp.os.windows-10 Subject: Re: Tip: full network reset Date: Sun, 11 Oct 2026 01:53:13 -0700 Organization: A noiseless patient Spider Lines: 164 Message-ID: <11afipr$2fq2n$1@dont-email.me> References: <11ad9na$1mp2o$1@dont-email.me> <11adtmo$q4e$1@nnrp.usenet.blueworldhosting.com> MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 8bit Injection-Date: Sun, 11 Oct 2026 08:53:16 +0000 (UTC) Injection-Info: dont-email.me; logging-data="2615383"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX19Uov5AVQvQxUbSFHX7UoxguOaxO0itg3k="; posting-host="56b384a47ff5b3759720b9c212d2b0f7" User-Agent: Betterbird (Linux) Cancel-Lock: sha1:h7adGM2BOA3ner84dNBkDjPzJS4= sha256:lJQeQMpJXVPGklFw7ZfW6dVfFrmTRKun0V5Z/pIjFuI= sha1:j4gQL9I7uY4RzOWgqQNgRYK03N8= sha256:jw/TKsTDBkIAQDW7u/schYpz9iJfgWyNDt2777GwNns= Content-Language: en-US In-Reply-To: <11adtmo$q4e$1@nnrp.usenet.blueworldhosting.com>