1. 命令行方式
- 新建txt文档,写入如下内容
Windows Registry Editor Version 5.00
[HKEY_CLASSES_ROOT\*\shell\NotePad++]
@="NotePad++"
"Icon"="D:\\Software\\Notepad++\\notepad++.exe"
[HKEY_CLASSES_ROOT\*\shell\NotePad++\Command]
@="\"D:\\Software\\Notepad++\\notepad++.exe\" \"%1\""
- 保存文件,修改文件后缀.txt为.reg
- 双击该文件写入注册表
2. 直接修改注册表
不想使用代码可以直接修改注册表
- win +r 输入regedit 打开注册表
- 在shell下新建Notepad项和Command项:
- 编辑属性
- 确定,完成
参考:
[1]让NotePad++添加到右键快捷方式 作者:Humbinal
[2] 右键菜单栏添加notepad++选项 作者: icecoola_