Skip to content

Instantly share code, notes, and snippets.

@Porygon31
Last active April 2, 2025 01:03
Show Gist options
  • Save Porygon31/16f3ca9e321ea7497c2f98c519878354 to your computer and use it in GitHub Desktop.
Save Porygon31/16f3ca9e321ea7497c2f98c519878354 to your computer and use it in GitHub Desktop.
Remove/Enable the new context menu that was added on Windows 11
REM This script remove/re-enable the new context menu added on Windows 11.
@echo off
REM ---------- Main ----------
cls
echo Please remember that this program will kill and restart explorer.exe so if you have any important work in progress
echo Please make sure to save it and exit this software before proceeding further.
choice /c yn /m "Are you ready"
if errorlevel 2 (
goto :exit
) else if errorlevel 1 (
cls
choice /c yne /m "Remove the new Win 11 context menu by the classic one (y) or re-enable the Windows 11 context menu (n) ? Press (e) to exit"
if errorlevel 3 (
goto :exit
) else if errorlevel 2 (
goto :enableWin11ContextMenu
) else if errorlevel 1 (
goto :removeWin11ContextMenu
) else (
goto :error
)
) else (
goto :error
)
REM ---------- Variable declaration ----------
:removeWin11ContextMenu
reg.exe add "HKCU\Software\Classes\CLSID\{86ca1aa0-34aa-4e8b-a509-50c905bae2a2}\InprocServer32" /f /ve
timeout /t 1 > nul
echo:
echo Kill explorer.exe
timeout /t 1 > nul
taskkill /f /im explorer.exe
echo:
echo Restart of explorer.exe
start explorer.exe
echo:
timeout /t 2 > nul
pause
goto :end
:enableWin11ContextMenu
reg delete "HKCU\Software\Classes\CLSID\{86ca1aa0-34aa-4e8b-a509-50c905bae2a2}" /f
timeout /t 1 > nul
echo:
echo Kill explorer.exe
timeout /t 1 > nul
taskkill /f /im explorer.exe
echo:
echo Restart of explorer.exe
start explorer.exe
echo:
timeout /t 2 > nul
pause
goto :end
:error
echo An error occuried, try to restart the script.
pause
exit
:exit
echo Exit the program...
timeout /t 1 > nul
exit
:end
cls
echo:
echo Made by Porygon
timeout /t 2 > nul
cls
exit
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment