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.\""
相关推荐
OliverH-yishuihan37 分钟前
在 Windows 上安装 Linux
linux·运维·windows
淼淼7631 小时前
工厂方法模式
开发语言·c++·windows·qt·工厂方法模式
ForteScarlet2 小时前
如何解决 Kotlin/Native 在 Windows 下 main 函数的 args 乱码?
开发语言·windows·kotlin
WTCLLB3 小时前
Windows命令和工具名称
windows
YCOSA20253 小时前
雨晨 Windows 11 企业版 26H1 轻装版 28020.1362
windows
陈陈爱java3 小时前
Conda 常用命令行
linux·windows·conda
狮智先生3 小时前
【编程实践】Windows + PySide6 + Matplotlib 绘图时 WinError 32 的完整排查与解决方案
windows·ui·个人开发·matplotlib·交通物流
czhc11400756634 小时前
c# 1216
windows·microsoft·c#
JPX-NO4 小时前
windows下编程IDE使用docker搭建的rust开发环境(Linux)
ide·windows·docker·rust
大猫和小黄6 小时前
Windows环境下使用Nacos搭建若依(RuoYi)微服务版完整指南
windows·微服务·架构