windows手动添加鼠标右键弹窗快捷方式

此处以添加Git Bash Here为例

一.操作步骤

  1. Win + R 键打开 运行 对话框,输入 regedit,并按下回车,打开注册表编辑器。

  2. 导航到 HKEY_CLASSES_ROOT\Directory\Background\shell

  3. 右键单击 shell,选择 新建 ,并命名为 Git Bash Here

  4. 右键新建的项 Git Bash Here,选择 新建字符串值 ,命名为 Icon,然后将其值设置为 Git 安装目录下的 bash.exe 文件的路径(例如:E:\Git\bin\bash.exe)。

  5. Git Bash Here 项下,右键单击并选择 新建 ,命名为 command

  6. command 项下,右键单击并选择 修改 ,然后将其值设置为 Git 安装目录下的 bash.exe,并加上参数 --login -i(例如:E:\Git\bin\bash.exe --login -i)。

二.注册表文件

也可以写成*.reg文件,直接双击添加到本机注册表,快捷方便

git_gui.reg

bash 复制代码
Windows Registry Editor Version 5.00

[HKEY_CLASSES_ROOT\Directory\Background\shell\git_gui]
@="Git &GUI Here"
"Icon"="E:\\Git\\cmd\\git-gui.exe"

[HKEY_CLASSES_ROOT\Directory\Background\shell\git_gui\command]
@="\"E:\\Git\\cmd\\git-gui.exe\" \"--working-dir\" \"%v.\""

git_shell.reg

bash 复制代码
Windows Registry Editor Version 5.00

[HKEY_CLASSES_ROOT\Directory\Background\shell\git_shell]
@="Git Ba&sh Here"
"Icon"="E:\\Git\\git-bash.exe"

[HKEY_CLASSES_ROOT\Directory\Background\shell\git_shell\command]
@="\"E:\\Git\\git-bash.exe\" \"--cd=%v.\""
相关推荐
Clownseven5 小时前
阿里云ECS安装Windows Server 2022教程 | 纯文字分步指南
windows·阿里云·云计算
T0uken5 小时前
【C++】LLVM-mingw + VSCode:Windows 开发攻略
c++·windows·vscode
能摆一天是一天12 小时前
JAVA stream().flatMap()
java·windows
JosieBook13 小时前
【远程运维】Linux 远程连接 Windows 好用的软件:MobaXterm 实战指南
linux·运维·windows
方圆工作室16 小时前
Arduino音乐键盘程序
单片机·嵌入式硬件·计算机外设
该用户已不存在20 小时前
你没有听说过的7个Windows开发必备工具
前端·windows·后端
枫叶落雨22220 小时前
注解参数校验
windows
通达的K20 小时前
Java实战项目演示代码及流的使用
java·开发语言·windows
胡耀超20 小时前
3.Python高级数据结构与文本处理
服务器·数据结构·人工智能·windows·python·大模型