4

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 ?

4 Answers 4

4
  • #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*"
3
  • when I try to run this .vbs file, I get an error at Line 1, Char 1, "Expected statement". I'm not familiar with this 0<xml syntax but does not look like .vbs to me. Could you please explain more or test? (I tried on windows 11) Commented Jan 22 at 12:44
  • hi, thanks for test and comments...
    – Io-oI
    Commented Jan 22 at 14:12
  • @Spectraljump If you are trying to use the code, save it in a file SomeName.cmd, and try again that way. I'm here as long as you need, come back in any error event... feel free...
    – Io-oI
    Commented Jan 22 at 14:15
0

You need to know the GUID for your machine for Airplane mode.

Open an admin Command Prompt.

powercfg -list to see the plans and the GUIDs

Then, powercfg /delete {GUID of Airplane Plan}.

To re-enable Airplane mode is different:

Start, Settings, Network, Airplane Mode, Enable.

You need Windows Settings after this. It is a specialized plan (because it turns off Wireless and Bluetooth) so it is best managed by Windows.

You can make batch files of the first setting (delete), but it is unique to each machine. It can be re-enabled later if needed. It is not a useful plan and I do not need it because I am much more likely to use my phone on a plane. So I delete the plan.

Note: It also appears the a Windows Creator Feature Upgrade deleted all but the Balanced Plan. I realized that I just have one plan, where I used to have 3 or 4. So in reality, Airplane Mode is definitely best managed by Windows. I do not need it and deleted it. You may feel the same way (or not). But Airplane Mode is there and manageable via Windows .

https://answers.microsoft.com/en-us/windows/forum/windows_10-power/power-plans-missing/9885bdc8-b11f-4722-9e11-423ef77494a9

0
0

There is a registry key to do this:

HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\RadioManagement\SystemRadioState

(Default) DWORD

0 = Off 1 = On

Try this batch file:

@echo off
(
echo Windows Registry Editor Version 5.00
echo.
echo [HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\RadioManagement]
echo "SystemRadioState"=dword:0
) >temp.reg
reg import "temp.reg"
1
  • All this code does is: it tells windows to enable (1) or disable (0) the Airplane Mode / Flight Mode feature (and make the button available in the ui etc), after next restart. It does NOT turn flight mode on or off! It makes the option available or not available. Commented Jan 22 at 12:52
0

This may be the simplest method although it requires admin.

:wifioff
 net stop WlanSvc &  goto :eof

:wifion
 net start WlanSvc & goto :eof

alternately reboot and the service is automatically restart so in case of error or to quickly fix as there isn't anything really changed.

0

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .