Windows 11 默认是精简右键,很多项要再点「显示更多选项」才出现。要把指定项默认显示,最稳妥是恢复经典完整菜单,或自己往右键里加一条命令。
1. 默认显示完整右键(最常用)
Win11 没有官方「把某一条从『更多选项』提上来」的开关。要默认看到 Git Bash、Open with Cursor、7-Zip 这类经典项,需要恢复旧版完整菜单。
以管理员打开 PowerShell:
powershell
reg add "HKCU\Software\Classes\CLSID\{86ca1aa0-34aa-4e8b-a509-50c905bae2a2}\InprocServer32" /f /ve
Stop-Process -Name explorer -Force
Start-Process explorer
之后右键会直接出完整菜单,不再先出精简菜单。
撤销:
powershell
reg delete "HKCU\Software\Classes\CLSID\{86ca1aa0-34aa-4e8b-a509-50c905bae2a2}" /f
Stop-Process -Name explorer -Force
Start-Process explorer
临时看完整菜单:右键时按 Shift+F10,或先右键再点「显示更多选项」。
2. 只加一条指定命令(文件 / 文件夹 / 空白处)
例如给文件夹加「在此打开 Git Bash」:
powershell
$cmd = "C:\Program Files\Git\git-bash.exe"
if (-not (Test-Path $cmd)) { $cmd = "C:\Program Files\Git\bin\bash.exe" }
reg add "HKCU\Software\Classes\Directory\shell\GitBashHere" /ve /d "在此打开 Git Bash" /f
reg add "HKCU\Software\Classes\Directory\shell\GitBashHere\command" /ve /d "`"$cmd`" --cd=`"%V`"" /f
reg add "HKCU\Software\Classes\Directory\Background\shell\GitBashHere" /ve /d "在此打开 Git Bash" /f
reg add "HKCU\Software\Classes\Directory\Background\shell\GitBashHere\command" /ve /d "`"$cmd`" --cd=`"%V`"" /f
对应位置:
| 右键对象 | 注册表路径 |
|---|---|
| 任意文件 | HKCU\Software\Classes\*\shell\你的项 |
| 文件夹 | HKCU\Software\Classes\Directory\shell\你的项 |
| 文件夹空白处 | HKCU\Software\Classes\Directory\Background\shell\你的项 |
仅 .md 等扩展名 |
HKCU\Software\Classes\SystemFileAssociations\.md\shell\你的项 |
命令里常用占位符:%1 是选中文件,%V 是当前目录。
图标(可选):
powershell
reg add "HKCU\Software\Classes\Directory\shell\GitBashHere" /v Icon /d "C:\Program Files\Git\git-bash.exe,0" /f
删掉这条菜单:
powershell
reg delete "HKCU\Software\Classes\Directory\shell\GitBashHere" /f
reg delete "HKCU\Software\Classes\Directory\Background\shell\GitBashHere" /f
注意:在 未恢复经典菜单 的 Win11 上,这种注册表项通常仍在「显示更多选项」里,不会进顶部精简菜单。要默认看见它,仍需第 1 步。
3. 精简菜单里出现(Win11 新菜单)
新右键只认 UWP / Sparse Package 的 IExplorerCommand,普通 .reg 加不进去。要进顶部精简菜单,需要:
- 软件自己适配(Cursor、VS Code 安装时勾选 "Add to context menu")
- 或第三方:Nilesoft Shell、ExplorerPatcher、StartAllBack
没有「勾选某几条经典项,让它们出现在新右键顶部」的系统设置。