r/PowerShell • • Dec 28 '25

Toggle Windows 11 Context menu

This script will toggle your default context menu in Windows 11 (Switch between the Win 11 and the "show more options" as default when you right click in Windows Explorer)

https://github.com/volshebork/PowerShell/blob/main/Context%20Menu/Toggle-ContextMenu.ps1

I am much more of a bash guy and I think too many comments is better than two few. I come from Linux, so I am not sure if there are any ps best practices I am missing. Hope this helps someone, because I know it is a game changer for me.

14 Upvotes

12 comments sorted by

View all comments

Show parent comment

8

u/OlivTheFrog Dec 28 '25

Ta version fait aussi un switch à chaque exécution.

L'équivalent PowerShell serait :

Remove-Item -Path "HKCU:\SOFTWARE\CLSID\{86ca1aa0-34aa-4e8b-a509-50c905bae2a2}\InprocServer32" -Force

New-Item -Path "HKCU:\SOFTWARE\\Classes\CLSID\{86ca1aa0-34aa-4e8b-a509-50c905bae2a2}\InprocServer32" " -Force

Le paramètre -Force est utilisé pour éviter la confirmation.

Et pour la ligne de commande "taskkill", utilise

Stop-Process -Name "Explorer.exe -force
New-Process -Name "explorer.exe -force # optional. Explorer.exe restart automatically

regards