Skip to main content

How to Disable or Enable Aero Shake in Batch Script

Aero Shake is a Windows feature that allows users to minimize all windows except the one they are actively shaking (dragging back and forth rapidly with the mouse). While some users find it a convenient way to declutter a busy desktop, others find it infuriating because it minimizes everything accidentally when they are simply repositioning a window.

In this guide, we will explore how to disable and re-enable Aero Shake using a Batch Script by modifying the appropriate Windows Registry key.

Understanding Aero Shake

Aero Shake was introduced in Windows 7 and remains present in Windows 10 and 11. The behavior is simple:

  1. Grab a window's title bar with the mouse.
  2. Shake it rapidly left and right.
  3. All other open windows minimize instantly.
  4. Shake the same window again, and the minimized windows restore.

The feature is controlled by a single registry value under the current user's Explorer advanced settings.

The Registry Key

HKCU\Software\Microsoft\Windows\CurrentVersion\Explorer\Advanced
Value Name: DisallowShaking
Type: REG_DWORD
  • 1 = Aero Shake is Disabled
  • 0 (or value not present) = Aero Shake is Enabled (default behavior)

Method 1: Disabling Aero Shake

@echo off
setlocal

echo Disabling Aero Shake...

REG ADD "HKCU\Software\Microsoft\Windows\CurrentVersion\Explorer\Advanced" /v DisallowShaking /t REG_DWORD /d 1 /f >nul

if %errorlevel% == 0 (
echo [SUCCESS] Aero Shake has been disabled.
echo You may need to restart Explorer or log off for the change to take effect.
) else (
echo [ERROR] Failed to modify the registry.
)

pause

When Does the Change Take Effect?

On Windows 11 22H2 and later, the change typically takes effect immediately without needing to restart Explorer or log off. On older versions of Windows 10, you may need to restart explorer.exe to see the behavior change.

To force a seamless refresh:

:: Optional: Restart Explorer to apply immediately
taskkill /f /im explorer.exe >nul 2>&1
timeout /t 2 /nobreak >nul
start explorer.exe

Method 2: Enabling Aero Shake (Restoring Default)

If Aero Shake was previously disabled and you want to bring it back:

@echo off
setlocal

echo Enabling Aero Shake...

:: Either set the value to 0 or delete it entirely
REG DELETE "HKCU\Software\Microsoft\Windows\CurrentVersion\Explorer\Advanced" /v DisallowShaking /f >nul 2>&1

if %errorlevel% == 0 (
echo [SUCCESS] Aero Shake has been re-enabled.
) else (
echo [INFO] DisallowShaking key did not exist. Aero Shake was already enabled.
)

pause

Why Delete Instead of Setting to 0?

Both approaches work. Setting DisallowShaking to 0 explicitly enables Aero Shake. Deleting the value entirely also enables it because the default behavior (when the value is absent) is Aero Shake ON. Deleting the key is cleaner because it returns the registry to its pristine state.

Method 3: Interactive Toggle Script

For power users who want a quick toggle utility:

@echo off
title Aero Shake Toggle
setlocal

:menu
cls
echo =============================================
echo AERO SHAKE MANAGER
echo =============================================
echo.

:: Read current status
set "status=ENABLED (Default)"
for /f "tokens=3" %%A in ('reg query "HKCU\Software\Microsoft\Windows\CurrentVersion\Explorer\Advanced" /v DisallowShaking 2^>nul ^| findstr /i "DisallowShaking"') do (
if "%%A" == "0x1" set "status=DISABLED"
if "%%A" == "0x0" set "status=ENABLED"
)

echo Current Status: %status%
echo.
echo [1] Disable Aero Shake
echo [2] Enable Aero Shake
echo [0] Exit
echo.
set /p "opt=Select: "

if "%opt%" == "1" goto do_disable
if "%opt%" == "2" goto do_enable
if "%opt%" == "0" exit /b
goto menu

:do_disable
REG ADD "HKCU\Software\Microsoft\Windows\CurrentVersion\Explorer\Advanced" /v DisallowShaking /t REG_DWORD /d 1 /f >nul
echo [OK] Aero Shake disabled.
pause
goto menu

:do_enable
REG DELETE "HKCU\Software\Microsoft\Windows\CurrentVersion\Explorer\Advanced" /v DisallowShaking /f >nul 2>&1
echo [OK] Aero Shake enabled.
pause
goto menu

Applying to All Users on the Machine

The DisallowShaking value under HKCU only affects the currently logged-in user. To apply the setting machine-wide for all existing and future users, you need to modify the default user profile and all loaded SIDs.

@echo off
setlocal enabledelayedexpansion

net session >nul 2>&1
if %errorlevel% neq 0 (
echo [ERROR] Administrator required for machine-wide changes.
pause
exit /b 1
)

echo Disabling Aero Shake for ALL users...

:: 1. Current user
REG ADD "HKCU\Software\Microsoft\Windows\CurrentVersion\Explorer\Advanced" /v DisallowShaking /t REG_DWORD /d 1 /f >nul
echo [OK] Current user

:: 2. Default user profile (new accounts)
REG LOAD "HKU\DefaultUser" "C:\Users\Default\NTUSER.DAT" >nul 2>&1
REG ADD "HKU\DefaultUser\Software\Microsoft\Windows\CurrentVersion\Explorer\Advanced" /v DisallowShaking /t REG_DWORD /d 1 /f >nul
REG UNLOAD "HKU\DefaultUser" >nul 2>&1
echo [OK] Default profile (new users^)

:: 3. All loaded user profiles
for /f "tokens=*" %%S in ('reg query HKU 2^>nul ^| findstr /r "S-1-5-21-"') do (
REG ADD "%%S\Software\Microsoft\Windows\CurrentVersion\Explorer\Advanced" /v DisallowShaking /t REG_DWORD /d 1 /f >nul 2>&1
echo [OK] %%S
)

echo.
echo [SUCCESS] Aero Shake disabled for all user profiles.
pause

Windows 11 Settings Integration

Starting with Windows 11 22H2, Microsoft added a GUI toggle for Aero Shake (called "Title bar window shake") under Settings > System > Multitasking. The registry key used by this toggle is the same DisallowShaking value we modify in our scripts, so the GUI and the script stay perfectly synchronized.

Common Mistakes

The Wrong Way: Using the Wrong Value Name

:: WRONG - "NoWindowMinimizingShortcuts" controls Win+Home, not shake
REG ADD "HKCU\Software\Microsoft\Windows\CurrentVersion\Explorer\Advanced" /v NoWindowMinimizingShortcuts /t REG_DWORD /d 1 /f

Output Concern: The NoWindowMinimizingShortcuts value disables the Win+Home keyboard shortcut (Aero Shake's keyboard equivalent), but it does not disable the mouse-based shake gesture. The correct value name is DisallowShaking.

The Wrong Way: Expecting Group Policy to Handle This

:: WRONG - There is no built-in Group Policy for Aero Shake
gpedit.msc

As of Windows 11, Microsoft has not provided a dedicated Group Policy Object for Aero Shake. The registry modification described in this guide is the only programmatic method.

Best Practices

  1. Use DisallowShaking under Explorer Advanced: This is the documented and GUI-synchronized registry value.
  2. Delete the value to re-enable: Returning to the default state is cleanest when the value is simply removed.
  3. Apply to the Default Profile: For enterprise deployments, load the default user hive and set the value there so all future user accounts inherit the setting.
  4. No Admin required for single-user: Modifying HKCU does not require elevation, making this an easy self-service fix for individual users.

Conclusion

Disabling or enabling Aero Shake via Batch Script is a single registry operation targeting the DisallowShaking DWORD value under the current user's Explorer Advanced settings. Setting it to 1 stops the shake-to-minimize behavior, while deleting the value restores it. For enterprise-wide deployments, extending the change to the default user profile and all loaded SIDs ensures a consistent experience across every account on the machine.