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.\""
相关推荐
the3clipse15 小时前
MPC-HC 下载安装与最佳配置教程:免费开源、轻量无广告、支持 4K 硬解的 Windows 播放器
windows·播放器·安装教程·硬件加速·mpc-hc·字幕设置·lav filters
独隅15 小时前
WebStorm Windows 版 React / Next.js 实战替换指南
javascript·windows·webstorm
陈工大模型16 小时前
2026年11月最新免费解压软件横评:7-Zip 、 Win解压缩名列前茅
windows·软件工程·7-zip·压缩软件
中二骚年2 天前
Windows 安全中心 / 防火墙故障,calc和Microsoft Store,终端(管理员)无法正常打开。 原因 + 修复方案
windows·安全·microsoft
万联WANFLOW2 天前
CVE-2026-98432 等漏洞自查:AI 查出的 Linux、Windows 漏洞,运维怎么确认受不受影响
linux·运维·windows·网络安全
AntsData2 天前
用 12K+ 条亚马逊评论信号,定位机械键盘下一版该改什么
java·大数据·计算机外设
AlanAshley2 天前
Windows 中导致延迟的软硬件及协议比重
windows
yuezhilangniao2 天前
win10中文 以及 PowerShell 开发日常
windows·powershell
时间的情敌2 天前
Vue3 + Cesium 鼠标交互绘制多边形 / 线(贴地绘制,动态预览,Entity 实现)
计算机外设
共享家95272 天前
408 操作系统第一章
服务器·数据库·windows