如何将Notepad ++设置为默认编辑器?


98

我想将Notepad ++设置为默认编辑器。我试图通过右键单击文件,然后单击“打开方式”进行设置。但是我没有在结果列表中看到Notepad ++(即使单击“选择其他程序”之后)。

当我尝试通过浏览选项重定向到Notepad ++进行notepad++.exe归档时,它什么也没做。(它无法识别)

在此处输入图片说明

Answers:


108
  1. 以提升的权限启动Notepad ++。

    在此处输入图片说明

  2. 在Notepad ++中,转到设置首选项...

  3. 转到“ 文件关联”选项卡。

  4. 选择fortran,TeX,SQL,然后.sql将其添加到注册的扩展中:

    在此处输入图片说明

  5. 单击关闭


10
此处的关键是Notepad ++ 必须以管理员身份(特权提升)运行,否则文件关联将不会“粘滞”。
Metro Smurf 2014年

在我的Windows 8计算机上做到了。用作管理员就好了,但是在那里建立的关联并不重要,因为这对我的用户帐户没有任何影响,该用户帐户没有保存那些首选项。这个应用程序在Windows 8吮吸
prl77

对于今天安装的6.7.9.2版本的Notepad ++,它对我不起作用。我被卡住了,并且可以与以前的版本一起使用...知道吗?
奥利弗(Oliver)

2
可惜的是,这并不能解释为什么 Windows(7?)的行为如此。
jiggunjer '16

3
完成上述步骤后,此外,我还必须使用“打开方式”将记事本与文件类型相关联(现在记事本++显示在列表中)。然后,文件的图标发生更改,并双击它在Notepad ++中将其打开。太复杂了,没有理由...在这里找到了明确的解决方法步骤:github.com/notepad-plus-plus/notepad-plus-plus/issues/2454
mBardos

9

右键单击记事本图标并选择相关操作,以管理员身份启动notepad ++:

在此处输入图片说明

在中Settings > Preferences...,您可以使用以下对话框将所需的扩展名与Notepad ++关联:

notepad ++关联对话框

在这种情况下,单击红色轮廓箭头将使所有.txt与Notepad ++关联。


您不必以管理员身份启动notepad ++吗?
Nifle

9

您可以修改注册表。从这个网站上,我发现了一个相当彻底的regedit修改,对我来说很好用,并且确实更改了默认的右键单击“编辑”程序。

十六进制部分与Notepad ++的路径字符串相同,我不知道为什么将它们放在十六进制中,但这是无害的。同样,我没有创建此代码。

  1. 复制以下文本并将其粘贴到新的.txt中并保存
  2. 将其重命名为filename.reg。
  3. 然后,双击它并接受警告您修改注册表的弹出窗口。

Windows Registry Editor Version 5.00

[HKEY_CLASSES_ROOT\batfile\shell\edit\command]
@=hex(2):22,00,43,00,3a,00,5c,00,50,00,72,00,6f,00,67,00,72,00,61,00,6d,00,20,\
00,46,00,69,00,6c,00,65,00,73,00,20,00,28,00,78,00,38,00,36,00,29,00,5c,00,\
4e,00,6f,00,74,00,65,00,70,00,61,00,64,00,2b,00,2b,00,5c,00,6e,00,6f,00,74,\
00,65,00,70,00,61,00,64,00,2b,00,2b,00,2e,00,65,00,78,00,65,00,22,00,20,00,\
22,00,25,00,31,00,22,00,00,00

[HKEY_CLASSES_ROOT\batfile\shell\print\command]
@=hex(2):22,00,43,00,3a,00,5c,00,50,00,72,00,6f,00,67,00,72,00,61,00,6d,00,20,\
00,46,00,69,00,6c,00,65,00,73,00,20,00,28,00,78,00,38,00,36,00,29,00,5c,00,\
4e,00,6f,00,74,00,65,00,70,00,61,00,64,00,2b,00,2b,00,5c,00,6e,00,6f,00,74,\
00,65,00,70,00,61,00,64,00,2b,00,2b,00,2e,00,65,00,78,00,65,00,22,00,20,00,\
2f,00,70,00,20,00,22,00,25,00,31,00,22,00,00,00

[HKEY_CLASSES_ROOT\cmdfile\shell\edit\command]
@=hex(2):22,00,43,00,3a,00,5c,00,50,00,72,00,6f,00,67,00,72,00,61,00,6d,00,20,\
00,46,00,69,00,6c,00,65,00,73,00,20,00,28,00,78,00,38,00,36,00,29,00,5c,00,\
4e,00,6f,00,74,00,65,00,70,00,61,00,64,00,2b,00,2b,00,5c,00,6e,00,6f,00,74,\
00,65,00,70,00,61,00,64,00,2b,00,2b,00,2e,00,65,00,78,00,65,00,22,00,20,00,\
22,00,25,00,31,00,22,00,00,00

[HKEY_CLASSES_ROOT\cmdfile\shell\print\command]
@=hex(2):22,00,43,00,3a,00,5c,00,50,00,72,00,6f,00,67,00,72,00,61,00,6d,00,20,\
00,46,00,69,00,6c,00,65,00,73,00,20,00,28,00,78,00,38,00,36,00,29,00,5c,00,\
4e,00,6f,00,74,00,65,00,70,00,61,00,64,00,2b,00,2b,00,5c,00,6e,00,6f,00,74,\
00,65,00,70,00,61,00,64,00,2b,00,2b,00,2e,00,65,00,78,00,65,00,22,00,20,00,\
2f,00,70,00,20,00,22,00,25,00,31,00,22,00,00,00

[HKEY_CLASSES_ROOT\inffile\shell\open\command]
@=hex(2):22,00,43,00,3a,00,5c,00,50,00,72,00,6f,00,67,00,72,00,61,00,6d,00,20,\
00,46,00,69,00,6c,00,65,00,73,00,20,00,28,00,78,00,38,00,36,00,29,00,5c,00,\
4e,00,6f,00,74,00,65,00,70,00,61,00,64,00,2b,00,2b,00,5c,00,6e,00,6f,00,74,\
00,65,00,70,00,61,00,64,00,2b,00,2b,00,2e,00,65,00,78,00,65,00,22,00,20,00,\
22,00,25,00,31,00,22,00,00,00

[HKEY_CLASSES_ROOT\inffile\shell\print\command]
@=hex(2):22,00,43,00,3a,00,5c,00,50,00,72,00,6f,00,67,00,72,00,61,00,6d,00,20,\
00,46,00,69,00,6c,00,65,00,73,00,20,00,28,00,78,00,38,00,36,00,29,00,5c,00,\
4e,00,6f,00,74,00,65,00,70,00,61,00,64,00,2b,00,2b,00,5c,00,6e,00,6f,00,74,\
00,65,00,70,00,61,00,64,00,2b,00,2b,00,2e,00,65,00,78,00,65,00,22,00,20,00,\
2f,00,70,00,20,00,22,00,25,00,31,00,22,00,00,00

[HKEY_CLASSES_ROOT\inifile\shell\open\command]
@=hex(2):22,00,43,00,3a,00,5c,00,50,00,72,00,6f,00,67,00,72,00,61,00,6d,00,20,\
00,46,00,69,00,6c,00,65,00,73,00,20,00,28,00,78,00,38,00,36,00,29,00,5c,00,\
4e,00,6f,00,74,00,65,00,70,00,61,00,64,00,2b,00,2b,00,5c,00,6e,00,6f,00,74,\
00,65,00,70,00,61,00,64,00,2b,00,2b,00,2e,00,65,00,78,00,65,00,22,00,20,00,\
22,00,25,00,31,00,22,00,00,00

[HKEY_CLASSES_ROOT\inifile\shell\print\command]
@=hex(2):22,00,43,00,3a,00,5c,00,50,00,72,00,6f,00,67,00,72,00,61,00,6d,00,20,\
00,46,00,69,00,6c,00,65,00,73,00,20,00,28,00,78,00,38,00,36,00,29,00,5c,00,\
4e,00,6f,00,74,00,65,00,70,00,61,00,64,00,2b,00,2b,00,5c,00,6e,00,6f,00,74,\
00,65,00,70,00,61,00,64,00,2b,00,2b,00,2e,00,65,00,78,00,65,00,22,00,20,00,\
2f,00,70,00,20,00,22,00,25,00,31,00,22,00,00,00

[HKEY_CLASSES_ROOT\JSEFile\Shell\Edit\Command]
@=”C:\Program Files (x86)\Notepad++\notepad++.exe” “%1″

[HKEY_CLASSES_ROOT\JSEFile\Shell\Print\Command]
@=”C:\Program Files (x86)\Notepad++\notepad++.exe” /p “%1″

[HKEY_CLASSES_ROOT\JSFile\Shell\Edit\Command]
@=”C:\Program Files (x86)\Notepad++\notepad++.exe” “%1″

[HKEY_CLASSES_ROOT\JSFile\Shell\Print\Command]
@=”C:\Program Files (x86)\Notepad++\notepad++.exe” /p “%1″

[HKEY_CLASSES_ROOT\regfile\shell\edit\command]
@=hex(2):22,00,43,00,3a,00,5c,00,50,00,72,00,6f,00,67,00,72,00,61,00,6d,00,20,\
00,46,00,69,00,6c,00,65,00,73,00,20,00,28,00,78,00,38,00,36,00,29,00,5c,00,\
4e,00,6f,00,74,00,65,00,70,00,61,00,64,00,2b,00,2b,00,5c,00,6e,00,6f,00,74,\
00,65,00,70,00,61,00,64,00,2b,00,2b,00,2e,00,65,00,78,00,65,00,22,00,20,00,\
22,00,25,00,31,00,22,00,00,00

[HKEY_CLASSES_ROOT\regfile\shell\print\command]
@=hex(2):22,00,43,00,3a,00,5c,00,50,00,72,00,6f,00,67,00,72,00,61,00,6d,00,20,\
00,46,00,69,00,6c,00,65,00,73,00,20,00,28,00,78,00,38,00,36,00,29,00,5c,00,\
4e,00,6f,00,74,00,65,00,70,00,61,00,64,00,2b,00,2b,00,5c,00,6e,00,6f,00,74,\
00,65,00,70,00,61,00,64,00,2b,00,2b,00,2e,00,65,00,78,00,65,00,22,00,20,00,\
2f,00,70,00,20,00,22,00,25,00,31,00,22,00,00,00

[HKEY_CLASSES_ROOT\Microsoft.PowerShellScript.1\Shell\Open\Command]
@=”C:\Program Files (x86)\Notepad++\notepad++.exe” “%1″

[HKEY_CLASSES_ROOT\Microsoft.PowerShellData.1\Shell\Open\Command]
@=”C:\Program Files (x86)\Notepad++\notepad++.exe” “%1″

[HKEY_CLASSES_ROOT\Microsoft.PowerShellModule.1\Shell\Open\Command]
@=”C:\Program Files (x86)\Notepad++\notepad++.exe” “%1″

[HKEY_CLASSES_ROOT\scriptletfile\Shell\Open\command]
@=”C:\Program Files (x86)\Notepad++\notepad++.exe” “%1″

[HKEY_CLASSES_ROOT\txtfile\shell\open\command]
@=hex(2):22,00,43,00,3a,00,5c,00,50,00,72,00,6f,00,67,00,72,00,61,00,6d,00,20,\
00,46,00,69,00,6c,00,65,00,73,00,20,00,28,00,78,00,38,00,36,00,29,00,5c,00,\
4e,00,6f,00,74,00,65,00,70,00,61,00,64,00,2b,00,2b,00,5c,00,6e,00,6f,00,74,\
00,65,00,70,00,61,00,64,00,2b,00,2b,00,2e,00,65,00,78,00,65,00,22,00,20,00,\
22,00,25,00,31,00,22,00,00,00

[HKEY_CLASSES_ROOT\txtfile\shell\print\command]
@=hex(2):22,00,43,00,3a,00,5c,00,50,00,72,00,6f,00,67,00,72,00,61,00,6d,00,20,\
00,46,00,69,00,6c,00,65,00,73,00,20,00,28,00,78,00,38,00,36,00,29,00,5c,00,\
4e,00,6f,00,74,00,65,00,70,00,61,00,64,00,2b,00,2b,00,5c,00,6e,00,6f,00,74,\
00,65,00,70,00,61,00,64,00,2b,00,2b,00,2e,00,65,00,78,00,65,00,22,00,20,00,\
2f,00,70,00,20,00,22,00,25,00,31,00,22,00,00,00

[HKEY_CLASSES_ROOT\txtfile\shell\printto\command]
@=hex(2):22,00,43,00,3a,00,5c,00,50,00,72,00,6f,00,67,00,72,00,61,00,6d,00,20,\
00,46,00,69,00,6c,00,65,00,73,00,20,00,28,00,78,00,38,00,36,00,29,00,5c,00,\
4e,00,6f,00,74,00,65,00,70,00,61,00,64,00,2b,00,2b,00,5c,00,6e,00,6f,00,74,\
00,65,00,70,00,61,00,64,00,2b,00,2b,00,2e,00,65,00,78,00,65,00,22,00,20,00,\
2f,00,70,00,74,00,20,00,22,00,25,00,31,00,22,00,20,00,22,00,25,00,32,00,22,\
00,20,00,22,00,25,00,33,00,22,00,20,00,22,00,25,00,34,00,22,00,00,00

[HKEY_CLASSES_ROOT\VBEFile\Shell\Edit\Command]
@=hex(2):22,00,43,00,3a,00,5c,00,50,00,72,00,6f,00,67,00,72,00,61,00,6d,00,20,\
00,46,00,69,00,6c,00,65,00,73,00,20,00,28,00,78,00,38,00,36,00,29,00,5c,00,\
4e,00,6f,00,74,00,65,00,70,00,61,00,64,00,2b,00,2b,00,5c,00,6e,00,6f,00,74,\
00,65,00,70,00,61,00,64,00,2b,00,2b,00,2e,00,65,00,78,00,65,00,22,00,20,00,\
22,00,25,00,31,00,22,00,00,00

[HKEY_CLASSES_ROOT\VBEFile\Shell\Print\Command]
@=hex(2):22,00,43,00,3a,00,5c,00,50,00,72,00,6f,00,67,00,72,00,61,00,6d,00,20,\
00,46,00,69,00,6c,00,65,00,73,00,20,00,28,00,78,00,38,00,36,00,29,00,5c,00,\
4e,00,6f,00,74,00,65,00,70,00,61,00,64,00,2b,00,2b,00,5c,00,6e,00,6f,00,74,\
00,65,00,70,00,61,00,64,00,2b,00,2b,00,2e,00,65,00,78,00,65,00,22,00,20,00,\
2f,00,70,00,20,00,22,00,25,00,31,00,22,00,00,00

[HKEY_CLASSES_ROOT\VBSFile\Shell\Edit\Command]
@=hex(2):22,00,43,00,3a,00,5c,00,50,00,72,00,6f,00,67,00,72,00,61,00,6d,00,20,\
00,46,00,69,00,6c,00,65,00,73,00,20,00,28,00,78,00,38,00,36,00,29,00,5c,00,\
4e,00,6f,00,74,00,65,00,70,00,61,00,64,00,2b,00,2b,00,5c,00,6e,00,6f,00,74,\
00,65,00,70,00,61,00,64,00,2b,00,2b,00,2e,00,65,00,78,00,65,00,22,00,20,00,\
22,00,25,00,31,00,22,00,00,00

[HKEY_CLASSES_ROOT\VBSFile\Shell\Print\Command]
@=hex(2):22,00,43,00,3a,00,5c,00,50,00,72,00,6f,00,67,00,72,00,61,00,6d,00,20,\
00,46,00,69,00,6c,00,65,00,73,00,20,00,28,00,78,00,38,00,36,00,29,00,5c,00,\
4e,00,6f,00,74,00,65,00,70,00,61,00,64,00,2b,00,2b,00,5c,00,6e,00,6f,00,74,\
00,65,00,70,00,61,00,64,00,2b,00,2b,00,2e,00,65,00,78,00,65,00,22,00,20,00,\
2f,00,70,00,20,00,22,00,25,00,31,00,22,00,00,00

[HKEY_CLASSES_ROOT\Windows.XamlDocument\shell\edit\command]
@=hex(2):22,00,43,00,3a,00,5c,00,50,00,72,00,6f,00,67,00,72,00,61,00,6d,00,20,\
00,46,00,69,00,6c,00,65,00,73,00,20,00,28,00,78,00,38,00,36,00,29,00,5c,00,\
4e,00,6f,00,74,00,65,00,70,00,61,00,64,00,2b,00,2b,00,5c,00,6e,00,6f,00,74,\
00,65,00,70,00,61,00,64,00,2b,00,2b,00,2e,00,65,00,78,00,65,00,22,00,20,00,\
22,00,25,00,31,00,22,00,00,00

[HKEY_CLASSES_ROOT\Windows.Xbap\shell\edit\command]
@=hex(2):22,00,43,00,3a,00,5c,00,50,00,72,00,6f,00,67,00,72,00,61,00,6d,00,20,\
00,46,00,69,00,6c,00,65,00,73,00,20,00,28,00,78,00,38,00,36,00,29,00,5c,00,\
4e,00,6f,00,74,00,65,00,70,00,61,00,64,00,2b,00,2b,00,5c,00,6e,00,6f,00,74,\
00,65,00,70,00,61,00,64,00,2b,00,2b,00,2e,00,65,00,78,00,65,00,22,00,20,00,\
22,00,25,00,31,00,22,00,00,00

[HKEY_CLASSES_ROOT\Windows.CompositeFont\shell\open\command]
@=hex(2):22,00,43,00,3a,00,5c,00,50,00,72,00,6f,00,67,00,72,00,61,00,6d,00,20,\
00,46,00,69,00,6c,00,65,00,73,00,20,00,28,00,78,00,38,00,36,00,29,00,5c,00,\
4e,00,6f,00,74,00,65,00,70,00,61,00,64,00,2b,00,2b,00,5c,00,6e,00,6f,00,74,\
00,65,00,70,00,61,00,64,00,2b,00,2b,00,2e,00,65,00,78,00,65,00,22,00,20,00,\
22,00,25,00,31,00,22,00,00,00

[HKEY_CLASSES_ROOT\WSFFile\Shell\Edit\Command]
@=hex(2):22,00,43,00,3a,00,5c,00,50,00,72,00,6f,00,67,00,72,00,61,00,6d,00,20,\
00,46,00,69,00,6c,00,65,00,73,00,20,00,28,00,78,00,38,00,36,00,29,00,5c,00,\
4e,00,6f,00,74,00,65,00,70,00,61,00,64,00,2b,00,2b,00,5c,00,6e,00,6f,00,74,\
00,65,00,70,00,61,00,64,00,2b,00,2b,00,2e,00,65,00,78,00,65,00,22,00,20,00,\
22,00,25,00,31,00,22,00,00,00

[HKEY_CLASSES_ROOT\WSFFile\Shell\Print\Command]
@=hex(2):22,00,43,00,3a,00,5c,00,50,00,72,00,6f,00,67,00,72,00,61,00,6d,00,20,\
00,46,00,69,00,6c,00,65,00,73,00,20,00,28,00,78,00,38,00,36,00,29,00,5c,00,\
4e,00,6f,00,74,00,65,00,70,00,61,00,64,00,2b,00,2b,00,5c,00,6e,00,6f,00,74,\
00,65,00,70,00,61,00,64,00,2b,00,2b,00,2e,00,65,00,78,00,65,00,22,00,20,00,\
2f,00,70,00,20,00,22,00,25,00,31,00,22,00,00,00

[HKEY_CLASSES_ROOT\zapfile\shell\open\command]
@=hex(2):22,00,43,00,3a,00,5c,00,50,00,72,00,6f,00,67,00,72,00,61,00,6d,00,20,\
00,46,00,69,00,6c,00,65,00,73,00,20,00,28,00,78,00,38,00,36,00,29,00,5c,00,\
4e,00,6f,00,74,00,65,00,70,00,61,00,64,00,2b,00,2b,00,5c,00,6e,00,6f,00,74,\
00,65,00,70,00,61,00,64,00,2b,00,2b,00,2e,00,65,00,78,00,65,00,22,00,20,00,\
22,00,25,00,31,00,22,00,00,00

[HKEY_CLASSES_ROOT\zapfile\shell\print\command]
@=hex(2):22,00,43,00,3a,00,5c,00,50,00,72,00,6f,00,67,00,72,00,61,00,6d,00,20,\
00,46,00,69,00,6c,00,65,00,73,00,20,00,28,00,78,00,38,00,36,00,29,00,5c,00,\
4e,00,6f,00,74,00,65,00,70,00,61,00,64,00,2b,00,2b,00,5c,00,6e,00,6f,00,74,\
00,65,00,70,00,61,00,64,00,2b,00,2b,00,2e,00,65,00,78,00,65,00,22,00,20,00,\
2f,00,70,00,20,00,22,00,25,00,31,00,22,00,00,00

[HKEY_CLASSES_ROOT\zapfile\shell\printto\command]
@=hex(2):22,00,43,00,3a,00,5c,00,50,00,72,00,6f,00,67,00,72,00,61,00,6d,00,20,\
00,46,00,69,00,6c,00,65,00,73,00,20,00,28,00,78,00,38,00,36,00,29,00,5c,00,\
4e,00,6f,00,74,00,65,00,70,00,61,00,64,00,2b,00,2b,00,5c,00,6e,00,6f,00,74,\
00,65,00,70,00,61,00,64,00,2b,00,2b,00,2e,00,65,00,78,00,65,00,22,00,20,00,\
2f,00,70,00,74,00,20,00,22,00,25,00,31,00,22,00,20,00,22,00,25,00,32,00,22,\
00,20,00,22,00,25,00,33,00,22,00,20,00,22,00,25,00,34,00,22,00,00,00

我也想要一个不使用notepad ++而是Windows的解决方案,因为我知道它与注册表有关。我需要为所有文件使用此选项(不仅仅是SQL等)。因此,我同意所提议的解决方案不是正确的解决方案。我验证了十六进制实际上只是“ notepad ++”。尚未通过应用补丁进行测试。
2014年

2
它仅在已安装Notepad ++ "C:\Program Files (x86)\Notepad++\notepad++.exe"的情况下才有效(这是默认设置),否则它将失败。真正不需要将这些命令编写为十六进制字符串,也可以接受带有适当转义符的纯文本。使用如下在线工具将这些十六进制文本转换为字符串不是太复杂:codebeautify.org/hex-string-converter。顺便说一句,第一个十六进制文本可以解码为"C:\Program Files (x86)\Notepad++\notepad++.exe" "%1"
Sk8erPeter

1
I don't understand the upvotes and the selection of the right answer. None of these answers are answering the question,也许过去它不起作用,但现在按照公认的答案说,它将默认情况下绑定在notepad ++上打开的文件。
Prix

Windows 7 Enterprise很有魅力。谢谢!
Mandark


By using our site, you acknowledge that you have read and understand our Cookie Policy and Privacy Policy.
Licensed under cc by-sa 3.0 with attribution required.