Just use your command line or cmd/bat file and disable your Wi-Fi adapter:
%__APPDIR__%wbem\wmic.exe path win32_networkadapter where NetConnectionID="Wi-fI" call disable
To enable:
%__APPDIR__%wbem\wmic.exe path win32_networkadapter where NetConnectionID="Wi-fI" call enable
Obs.: This command line needs administrator rights
Read more
You can also use a hybrid bat file with the code vbs, which will call the airplane interface mode and disable it by sending the [space] key:
0<!-- :
@cls & @echo off && mode 50,03 && title <nul && title .\%~nx0 && explorer.exe ms-settings:network-airplanemode
%__APPDIR__%wScript.exe "%~dpnx0?.wsf" && 2>nul >nul %__APPDIR__%taskkill.exe /FI "WindowTitle eq settings*"
goto :EOF & rem :: --> <job> <script language = "vbscript">
Set objShell = WScript.CreateObject("WScript.Shell")
objShell.AppActivate "settings"
WScript.Sleep 333
objShell.SendKeys " "
WScript.Sleep 333 </script></job>
0<!-- : &@cls & @echo off && mode 50,03 && title <nul && title .\%~nx0 && explorer.exe ms-settings:network-airplanemode
%__APPDIR__%wScript.exe "%~dpnx0?.wsf" && 2>nul >nul %__APPDIR__%taskkill.exe /FI "WindowTitle eq settings*"
goto :EOF & rem :: --> <job> <script language = "vbscript"> Set objShell = WScript.CreateObject("WScript.Shell")
objShell.AppActivate "settings": WScript.Sleep 500: objShell.SendKeys " ": WScript.Sleep 777: </script></job>
Obs.: For close/kill windows/interface, you need edit the correct name of windows title, in pt-BR work with configur*
, I suppose in English maybe setting*
:
2>nul >nul %__APPDIR__%taskkill.exe /FI "WindowTitle eq settings*"
2>nul >nul %__APPDIR__%taskkill.exe /FI "WindowTitle eq settings*"
Nice one dude, even though it interacts with GUI ultimately, but it does save lot of efforts, thanks a lot !!! – Vicky Dev – 2020-02-26T01:45:30.960
Option # 1 does the same for the command line and the results/effects are also the same. – It Wasn't Me – 2020-02-26T05:30:37.887