右键菜单添加Open Powershell Here

问题描述

如何在 Windows 桌面右键或者在文件夹右键菜单中添加 Open Powershell Here 项目。想要实现该功能,需要

在注册表HKEY_CLASSES_ROOT\Directory\中修改相关项。具体如下:

解决方法

  1. 打开注册表: Win+r,输入regedit

  2. 找到 HKEY_CLASSES_ROOT\Directory\

    • 文件夹中右键: HKEY_CLASSES_ROOT\Directory\shell
    • 桌面右键:HKEY_CLASSES_ROOT\Directory\Background\shell
  3. 新建项,命名powershell7

  4. powershell7项,右侧的默认项中写入 Open PowerShell Here

  5. powershell7项,右侧新建字符串值。命名 Icon,写入C:\Program Files\PowerShell\7\pwsh.exe

  6. powershell7下新建项 ,命名 command

  7. powershell7\command项,右侧默认项中写入 "C:\Program Files\PowerShell\7\pwsh.exe"


本博客所有文章除特别声明外,均采用 CC BY-SA 4.0 协议 ,转载请注明出处!