Solved Airplane Mode Toggle .exe


dacrone

Well-known member
Pro User
VIP
Local time
12:11 AM
Posts
3,184
OS
Windows 11 Pro
EDIT: .exe changed. this is completely programmatic. no visual elements.

Had to do this for a test. if anyone else wants a direct shortcut to turn on/off airplane mode, download attached and change the extension from .txt to .exe

code from AHK that is compiled:
 
Last edited:

My Computer

System One

  • OS
    Windows 11 Pro
@garlin

think you can work your magic for this or the other linked ahks i made? would be way more useful to people if it can be done invisibly via a batch rather than launching the settings interface and auto changing the settings. i could not find the programmatic way of accomplishing these changes.
(similar to how you came up with .https://www.elevenforum.com/t/let-slideshow-run-even-if-im-on-battery-power.34324/post-575057 that .bat)
if you'd rather ping me offline and teach me to fish, that works. don't want to bug you with little stuff like this too often.

.https://www.elevenforum.com/t/night-light-toggle-exe.32154/

.https://www.elevenforum.com/t/focus-assist-do-not-disturb-toggle-scripts-exe.32153/
 

My Computer

System One

  • OS
    Windows 11 Pro
Here's my trade secret: Don't listen to @pseymour, he's knee deep in the ProcMon Mafia...

1. Download NirSoft's RegistryChangesView.

2. Prep whatever Windows UI-based change is about to happen, but don't click OK. You want to keep the capture time as short as humanly possible, to prevent capturing too many background changes that Windows makes for itself, or related to you simply clicking around the desktop.

3. Run RegistryChangesView. If you have a previous capture folder, I usually delete it before opening RegistryChangesView. The tool can source between different capture points, but for simplicity just keep it plain and stupid.

4. Click the Create Registry Snapshot button in the top right of the popup. Repeat with the next button.

5. Invoke the pending Windows change by hitting OK.

6. Immediately return to RegistryChangesView and hit OK. Now it creates a pending diff between the first snapshot and when you clicked OK.

7. You can search for changes on the scroll list. I like to Select All, then right-menu Copy As .Reg File Format.

8. Browse and try to be intelligent about which change(s) are actually relevant.

UWP apps don't store their metadata in the Windows registry, so RegistryChangesView is useless for those apps. You have to "reg load" their private registry hives under the AppData\Local\Packages\[App] folders.


I don't have a laptop for testing Airplane mode. But presumably Settings looks for some Wi-Fi device instance, and begins changing a set of reg values related to that device.

So it becomes a two-fold problem:
- Deciphering how you find the same device instance by browsing other registry keys (or by using PS cmdlets and WMI objects).
- After determining the relative registry path for the user's instance, applying the same set of changes.

You may have to reset the capture (I do it so there's no accidental confusion because you diff'ed the wrong set of older snapshots), and reverse the Airplane mode to see what the changes are in the opposite direction.

If you search I see a lot of advice for making a functionally equivalent change (ie. disabling the Wi-Fi network, or stopping the Wireless service), but in the end they're probaly not a faithful duplicate of what Settings has done.
 

My Computer

System One

  • OS
    Windows 7
I noticed Brink has a Tutorial, but his .reg file requires you to reboot. So I would also check if the Wireless service is running or not, because Settings and the Control Center don't obviously need to reboot Windows.
 

My Computer

System One

  • OS
    Windows 7
I noticed Brink has a Tutorial, but his .reg file requires you to reboot. So I would also check if the Wireless service is running or not, because Settings and the Control Center don't obviously need to reboot Windows.
1 down. @Brink feel free to share this too if desired.
 

My Computer

System One

  • OS
    Windows 11 Pro
Here's my trade secret: Don't listen to @pseymour, he's knee deep in the ProcMon Mafia...

1. Download NirSoft's RegistryChangesView.

By the way, I recommended RegistryChangesView almost a year ago, so 😜

 

My Computers

System One System Two

  • OS
    Windows 11 Pro 24H2
    Computer type
    PC/Desktop
    Manufacturer/Model
    Intel NUC12WSHi7
    CPU
    12th Gen Intel Core i7-1260P, 2100 MHz
    Motherboard
    NUC12WSBi7
    Memory
    64 GB
    Graphics Card(s)
    Intel Iris Xe
    Sound Card
    built-in Realtek HD audio
    Monitor(s) Displays
    Dell U3219Q
    Screen Resolution
    3840x2160 @ 60Hz
    Hard Drives
    Samsung SSD 990 PRO 1TB
    Keyboard
    CODE 104-Key Mechanical with Cherry MX Clears
    Antivirus
    Microsoft Defender
  • Operating System
    Linux Mint 21.2 (Cinnamon)
    Computer type
    PC/Desktop
    Manufacturer/Model
    Intel NUC8i5BEH
    CPU
    Intel Core i5-8259U CPU @ 2.30GHz
    Memory
    32 GB
    Graphics card(s)
    Iris Plus 655
    Keyboard
    CODE 104-Key Mechanical with Cherry MX Clears
Back
Top Bottom