方法一:编写代码键入注册表
将以下内容保存为
.reg
文件,双击运行即可(其中可执行文件路径和菜单项名称请自行替换(绿色部分)):
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\""
注:
删除右键
Windows Registry Editor Version 5.00
[-HKEY_CLASSES_ROOT\*\shell\NotePad++]
方法二:手动
1、打开注册表
(“win+R”或者点击开始菜单,找到运行,在运行输入框里面输入“regedit”)
打开HKEY_CLASSES_ROOT\ * \ Shell
新建子项Notepad++
在子项Notepad++下新建子项Command
右键点击修改子项Command的默认字符串值为: 路径名