將「PowerShell Here」和「Command Window Here」新增至磁碟機、資料夾和目前目錄的右鍵選單中

將「PowerShell Here」和「Command Window Here」新增至磁碟機、資料夾和目前目錄的右鍵選單中

我嘗試過應用和編輯 .reg 文件,例如,這裡這裡

但如果不按住 Shift 鍵,似乎無法在所有右鍵選單中獲得“PowerShell Here”和“Command Window”此處選項。

有沒有辦法使用單一 .reg 檔案將這些新增至每個右鍵選單(即磁碟機、資料夾和資料夾內的空白區域)?

這個問題有不同的形式這個

因為我還包括右鍵單擊當前打開的資料夾的空白區域(而不僅僅是直接單擊資料夾或驅動器)。

答案1

檢查字串值“extended”是否已重新命名或刪除以關閉“shift”要求,

至於另一件事,添加一個名為“NoWorkingDirectory”的字串值,即使沒有單擊任何資料夾,這也將允許兩者出現,

答案2

PowerShell 的解決方案:

  1. “Win + R”,執行regedit,開啟註冊表編輯器。
  2. 分別前往以下地點:

    HKEY_CLASSES_ROOT\目錄\shell\Powershell HKEY_CLASSES_ROOT\目錄\背景\shell\Powershell HKEY_CLASSES_ROOT\Drive\shell\Powershell

對於每個密鑰,右鍵單擊左側面板上的密鑰,“權限...”,“高級”,將所有者更改為“管理員”,然後將“完全控制”-“允許”分配給「管理員」。按“確定”。

  1. 對於每個按鍵,刪除右側面板上的「擴充」鍵。

來源

答案3

Windows Registry Editor Version 5.00

;新增_enhanced_cmd_and_powershell_to_menu.reg;這添加了 Command 和 Powershell 子選單選項

[HKEY_CLASSES_ROOT\Directory\Background\shell\01MenuCmd] "ExtendedSubCommandsKey"="Directory\ContextMenus\MenuCmd" "Icon"="cmd.exe" "MUIVerb"="命令提示字元"

[HKEY_CLASSES_ROOT\Directory\Background\shell\02MenuPowerShell] "ExtendedSubCommandsKey"="Directory\ContextMenus\MenuPowerShell" "Icon"="powershell.exe" "MUIVerb"="PowerShell 提示"

[HKEY_CLASSES_ROOT\Directory\ContextMenus\MenuCmd\shell\open] “圖示”=“cmd.exe” “MUIVerb”=“命令提示字元”

[HKEY_CLASSES_ROOT\Directory\ContextMenus\MenuCmd\shell\open\command] @="cmd.exe /s /k Pushd \"%V\""

[HKEY_CLASSES_ROOT\Directory\ContextMenus\MenuCmd\shell\runas] “HasLUAShield”=“”“圖示”=“cmd.exe”“MUIVerb”=“命令提示字元已提升”

[HKEY_CLASSES_ROOT\Directory\ContextMenus\MenuCmd\shell\runas\command] @="cmd.exe /s /k Pushd \"%V\""

[HKEY_CLASSES_ROOT\Directory\ContextMenus\MenuPowerShell\shell\open] “圖示”=“powershell.exe” “MUIVerb”=“PowerShell”

[HKEY_CLASSES_ROOT\Directory\ContextMenus\MenuPowerShell\shell\open\command] @="powershell.exe -noexit -command Set-Location '%V'"

[HKEY_CLASSES_ROOT\Directory\ContextMenus\MenuPowerShell\shell\runas] “HasLUAShield”=“”“圖示”=“powershell.exe”“MUIVerb”=“PowerShell 已提升”

[HKEY_CLASSES_ROOT\Directory\ContextMenus\MenuPowerShell\shell\runas\command] @="powershell.exe -noexit -command 設定位置'%V'"

[HKEY_CLASSES_ROOT\Directory\shell\01MenuCmd] “ExtendedSubCommandsKey”=“Directory\ContextMenus\MenuCmd” “圖示”=“cmd.exe” “MUIVerb”=“命令提示字元”

[HKEY_CLASSES_ROOT\Directory\shell\02MenuPowerShell] "ExtendedSubCommandsKey"="Directory\ContextMenus\MenuPowerShell" "Icon"="powershell.exe" "MUIVerb"="PowerShell 提示"

答案4

我創建了一個完全自動化的解決方案來新增 PS 和 CMD 上下文項目。只需運行 set_registry.cmd ,當在資料夾或某些打開的資料夾中單擊人民幣時,它將更新註冊表以添加兩個按鈕:

這會將註冊表項的擁有者變更為 admin 並新增上下文選單
更改註冊表以啟用 PS 和 CWD 上下文選單

相關內容