Windows – How to turn on/off Airplane Mode(Windows 10) thro’ Batch file or Command Prompt

airplane-modebatchcommand linewindowswindows 10

After going thro' all the crap answers posted in Tenforums and Eightforums, I have come to conclusion that almost no one knows, how to turn off/on Airplane Mode without need to restart the system i.e. changing the registry setting for the same.

Is it just me or all of 'em aren't aware that there is already an option in Taskbar that allows us to turn off/on Airplane mode without requiring system reboot. So it is definite sense that Airplane mode can and should be able to operate from Command Prompt/Batch file too, right?

So the ultimate question, can anyone let me know how to do that from command line or batch file, without Registry editing and further rebooting the system ?

Best Answer

  • #1 option

Just use your command line or / 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


  • #2 option

enter image description here

You can also use a hybrid file with the code , 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>
  • Or, compacted code...
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*"