Vista 引入的 Shift+右鍵擴展菜單 (「在此處打開命令窗口」、「複製為路徑」) 極大提升了效率,但內建項目有限。通過註冊表編輯,可將「加密/解密 (EFS)」、「清空回收站」等高頻操作永久添加到右鍵菜單,無需按鍵組合。本文提供註冊表精確路徑與導入現成 .reg 文件兩種方式。
註冊表路徑:HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Explorer\Advanced
操作:右側新建 DWORD (32 位) 值,名稱 EncryptionContextMenu,數值 1。按 F5 刷新或註銷重登。
效果:文件/資料夾右鍵菜單直接顯示「加密」/「解密」,點擊即可切換 EFS 狀態。
註冊表路徑:HKEY_CLASSES_ROOT\Directory\Background\ShellEx\ContextMenuHandlers
操作:在該項下新建項,名稱 {645FF040-5081-101B-9F08-00AA002F954E} (系統內建清空回收站擴展的 CLSID)。
效果:桌面或任意資料夾空白處右鍵即可直接清空回收站,無需先打開回收站窗口。
將以下內容保存為 CustomContextMenu.reg 雙擊導入 (需管理員權限):
Windows Registry Editor Version 5.00
; === 文件/資料夾右鍵:複製完整路徑 (無需 Shift) ===
[HKEY_CLASSES_ROOT\*\shell\CopyFullPath]
@="複製完整路徑"
[HKEY_CLASSES_ROOT\*\shell\CopyFullPath\command]
@="cmd /c echo %1|clip"
; === 資料夾右鍵:在此處打開 PowerShell ===
[HKEY_CLASSES_ROOT\Directory\shell\OpenPowerShellHere]
@="在此處打開 PowerShell"
[HKEY_CLASSES_ROOT\Directory\shell\OpenPowerShellHere\command]
@="powershell.exe -NoExit -Command Set-Location '%V'"
; === 資料夾背景右鍵:在此處打開 PowerShell ===
[HKEY_CLASSES_ROOT\Directory\Background\shell\OpenPowerShellHere]
@="在此處打開 PowerShell"
[HKEY_CLASSES_ROOT\Directory\Background\shell\OpenPowerShellHere\command]
@="powershell.exe -NoExit -Command Set-Location '%V'"
; === 文件右鍵:用記事本打開 (適用未知擴展名) ===
[HKEY_CLASSES_ROOT\*\shell\OpenWithNotepad]
@="用記事本打開"
[HKEY_CLASSES_ROOT\*\shell\OpenWithNotepad\command]
@="notepad.exe %1"
HKCR 需管理員權限,建議導出原鍵值備份。HKCU\Software\Classes\CLSID\{86ca1aa0-34aa-4e8b-a509-50c905bae2a2}\InprocServer32 才能恢復經典完整菜單。