ドライブ、フォルダ、現在のディレクトリの右クリック メニューに「PowerShell Here」と「Command Window Here」を追加します。

ドライブ、フォルダ、現在のディレクトリの右クリック メニューに「PowerShell Here」と「Command Window Here」を追加します。

たとえば、.regファイルを適用して編集してみました。ここそしてここ

しかし、Shift キーを押さないと、すべての右クリック メニューに「PowerShell Here」および「コマンド ウィンドウ here」オプションが表示されないようである。

1 つの .reg ファイルを使用して、これらをすべての右クリック メニュー (つまり、ドライブ、フォルダー、フォルダー内の空白) に追加する方法はありますか?

この質問は別の形式ですこれです

つまり、現在開いているフォルダーの空白部分を右クリックすることも含まれます (フォルダーまたはドライブを直接クリックするだけではありません)。

答え1

文字列値「extended」が名前変更または削除されて「shift」要件が満たされていることを確認します。

もう1つは、「NoWorkingDirectory」という文字列値を追加することです。これにより、フォルダがクリックされていない場合でも両方が表示されるようになります。

答え2

PowerShell のソリューション:

  1. 「Win + R」を押して、regedit を実行してレジストリ エディターを開きます。
  2. それぞれの場所へ移動します:

    HKEY_CLASSES_ROOT\Directory\shell\Powershell HKEY_CLASSES_ROOT\Directory\Background\shell\Powershell HKEY_CLASSES_ROOT\Drive\shell\Powershell

各キーについて、左パネルでキーを右クリックし、「アクセス許可...」、「詳細設定」の順に選択し、所有者を「管理者」に変更してから、「管理者」に「フル コントロール」 - 「許可」を割り当てます。「OK」を押します。

  1. 各キーについて、右側のパネルの「Extended」キーを削除します。

ソース

答え3

Windows Registry Editor Version 5.00

; Add_enhanced_cmd_and_powershell_to_menu.reg ; これにより、コマンドと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] "Icon"="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"="" "Icon"="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] "Icon"="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"="" "Icon"="powershell.exe" "MUIVerb"="PowerShell 昇格"

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

[HKEY_CLASSES_ROOT\Directory\shell\01MenuCmd] "ExtendedSubCommandsKey"="Directory\ContextMenus\MenuCmd" "Icon"="cmd.exe" "MUIVerb"="コマンド プロンプト"

[HKEY_CLASSES_ROOT\Directory\shell\02MenuPowerShell] "ExtendedSubCommandsKey"="Directory\ContextMenus\MenuPowerShell" "Icon"="powershell.exe" "MUIVerb"="PowerShell プロンプト"

答え4

PS および CMD コンテキスト項目を追加するための完全に自動化されたソリューションを作成しました。set_registry.cmd を実行するだけで、フォルダー上または開いているフォルダー内で右クリックしたときにレジストリが更新され、2 つのボタンが追加されます。

これにより、レジストリキーの所有者が管理者に変更され、コンテキストメニューが追加されます。
レジストリを変更して PS および CWD コンテキスト メニューを有効にする

関連情報