How do I set Notepad++ as the default editor?

98

12

I want set Notepad++ as the default editor. I tried to set it by right-clicking on a file, then Open With. But I did not see Notepad++ in the resulting list (even after clicking on Choose Other Programs).

When I try to redirect to Notepad++ through the Browse option to notepad++.exe file it is doing nothing. (Its not recognizing somehow)

enter image description here

madhu

Posted 2012-09-14T11:23:29.907

Reputation: 1 211

Answers

107

  1. Start Notepad++ with elevated privileges.

    enter image description here

  2. In Notepad++, go to Settings, Preferences...

  3. Go to the File Association tab.

  4. Select fortran,TeX,SQL and then .sql and add it to the registered extensions:

    enter image description here

  5. Click Close.

Der Hochstapler

Posted 2012-09-14T11:23:29.907

Reputation: 77 228

Did that in my Windows 8 computer. It took just fine as admin, but the associations made there do not matter much since it doesn't make a difference for my user account, which does not have those preferences saved. This app sucks on Windows 8. – prl77 – 2015-03-17T02:45:46.040

Did not work for me with the today installed 6.7.9.2 version of Notepad++. I'm stuck, and it worked with previous versions... Any idea ? – Oliver – 2015-07-01T18:31:14.470

2Shame this doesn't explain why Windows(7?) behaves like this. – jiggunjer – 2016-01-13T08:38:52.533

Doesn't work for me either. I even went and reg-edited the txt extention to open with notepad++ and it got a "unknown program" icon and asked me what program to open it with. Worse, the open with menu refuses to allow me to use notepad++ even if I browse to it! – Evil Spork – 2017-04-26T08:22:07.763

3

After following above steps, additionally, I had to associate Notepad to the file type using Open With (now Notepad++ showed up in the list). Then the file's icons changed and double clicking it opened it in Notepad++. Way too complicated, for no reason... Found clear workaround steps here: https://github.com/notepad-plus-plus/notepad-plus-plus/issues/2454

– mBardos – 2018-05-15T22:12:19.183

10The key here is that Notepad++ must be run as administrator (elevated privileges), otherwise the file association's will not "stick". – Metro Smurf – 2014-01-26T16:16:18.227

9

Start notepad++ as administrator, by right-clicking it's icon and selecting the relevant action:

enter image description here

In Settings > Preferences..., you can associate the extensions you want with Notepad++, using this dialog:

notepad++ association dialog

In this case, clicking on the red-outlined arrow would assicoate all .txt with Notepad++.

m4573r

Posted 2012-09-14T11:23:29.907

Reputation: 5 051

Don't you have to start notepad++ as administrator? – Nifle – 2012-09-14T11:35:46.097

9

You can modify the registry. From this website, I found a pretty thorough regedit modification that works fine for me and really changes the default right click "Edit" program.

The hex portions are just the same path string to Notepad++, I don't know why those were put in hex, but it is harmless. Again, I didn't create this code.

  1. Copy the following text and paste it in a new .txt and save it
  2. Rename it to filename.reg.
  3. And then just double-click it and accept the pop ups that warn you about modifying the registry.

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

Carles Alcolea

Posted 2012-09-14T11:23:29.907

Reputation: 210

I also wanted a solution without using notepad++ but rather Windows, since I know its a problem with the registry. I need this option for all files (not just SQL etc). So I agree that the upvoted solutions are not the right ones. I verified that the hex is actually just "notepad++". Haven't tested by applying the patch though. – Jus12 – 2014-08-01T10:25:04.340

2

It only works if Notepad++ has been installed to "C:\Program Files (x86)\Notepad++\notepad++.exe" (which is the default), otherwise it will fail. There is no real need to write these commands as hexadecimal strings, plain text is accepted too with appropriate escapings. It's not too complicated to convert these hexadecimal texts to string with online tools like this: http://codebeautify.org/hex-string-converter. BTW the first hexadecimal text can be decoded to "C:\Program Files (x86)\Notepad++\notepad++.exe" "%1".

– Sk8erPeter – 2015-12-29T16:04:49.187

1I don't understand the upvotes and the selection of the right answer. None of these answers are answering the question, perhaps in the past it didn't work but now doing as the accepted answer says, it will bind the files to be opened by default on notepad++. – Prix – 2016-07-06T18:33:54.470

Windows 7 Enterprise works as a charm. Thanks! – Mandark – 2017-08-10T08:52:26.070

5

As an alternative, you can also replace notepad.exe with notepad++.exe (or notepad2.exe or another editor).

Take a look at this gist to get an idea on how to do it: https://gist.github.com/amarraja/3938304

Ehtesh Choudhury

Posted 2012-09-14T11:23:29.907

Reputation: 1 330

1

This works too: http://www.binaryfortress.com/NotepadReplacer/Download/

– Doug – 2014-04-28T02:09:07.500

3

The most direct route I've found is tell Windows to use Notepad++ (or Notepad2 or...) instead of the system default Notepad.exe by leveraging Image File Execution. It's safer (and easier!) than replacing system files or messing about with multiple registry entries.

Other Sources:

matt wilkie

Posted 2012-09-14T11:23:29.907

Reputation: 4 147