Re: PSA: Simple Wi-Fi gateway killswitch that works with OpenVPN config files

Andy Burns <[email protected]> Fri, 17 Jul 2026 08:23:07 +0100
Newsgroups alt.comp.os.windows-10,alt.comp.os.windows-11,alt.comp.microsoft.windows
Message-ID <[email protected]>
Maria Sophia wrote:

> for /f "tokens=2,3 delims={,}" %%a in ('"WMIC NICConfig where IPEnabled="True" > get DefaultIPGateway /value | find "I" "') do if not defined ip set 
ip=%%~a

Bear in mind that the default install does not include WMIC since 24H2, 
worth having some form of test for

     if not exist %windir%\system32\wmic.exe