3

I tried to change the default text EDITING tool from notepad to notepad++, but for whatever reason it doesn't work. Note, that I DON'T want to make notepad++ the default program to open these kind of files. Thats a different issue. I want it to open when you rightclick a .txt file and click on 'edit'.

I've written a little .reg file

Windows Registry Editor Version 5.00
[HKEY_CLASSES_ROOT\SystemFileAssociations\document\shell\edit\command]
@="\"C:\\Program Files (x86)\\Notepad++\\notepad++.exe\" \"%1\""

The .reg file works alright, the value is changed. However, when rightclicking a .txt file and clicking 'edit', instead of opening the file in notepad++, Windows just opens the file dialog, asking me whether I want to continue opening this type of file with Notepad++ (which is already preselected).

What do I do wrong, how can I resolve this issue?

0

3 Answers 3

10

Solved the issue myself. Turned out you have to change the key in

[HKEY_CLASSES_ROOT\SystemFileAssociations\text\shell\edit\command] 
1
  • and under Computer\HKEY_CLASSES_ROOT\SystemFileAssociations\image\shell one can delete or change the edit entry and get rid of this default Edit entry in any picture contextual menu, calling Paint 3D instead of your preferred application.
    – mins
    May 17, 2022 at 11:34
1

To clarify, mine worked when I changed this Windows registry key:

Computer\HKEY_CLASSES_ROOT\SystemFileAssociations\text\shell\edit\command

From:

%SystemRoot%\system32\NOTEPAD.EXE %1

To:

%ProgramFiles%\WindowsApps\NightRise.NotepadWrapped_7.59.32.0_x64__bahp16nyyek9m\Notepad++.exe %1

Note, my Notepad++ installation was from the Windows Store, and I suspect the last portion of the path might differ on a different Windows 10 machine.

I found the exact path for Notepad++.exe by going to Windows task manager, right clicking the Notepad++ item, then selecting "Open File Location"

Hope that helps someone

0

Adding this from a Github because it's hard to find.., expanding on what Simmen mentioned.

https://gist.github.com/ma-al/6a70a55dca30f9e3d1cc473a43c87ec3

For Windows 10, to change the bat/ini/cmd "edit" context menu (right click, edit) change these keys in regedit:

Computer\HKEY_CLASSES_ROOT\SystemFileAssociations\text\shell\edit\command
Computer\HKEY_LOCAL_MACHINE\SOFTWARE\Classes\batfile\shell\edit\command
Computer\HKEY_LOCAL_MACHINE\SOFTWARE\Classes\cmdfile\shell\edit\command

From: %SystemRoot%\system32\NOTEPAD.EXE %1 to:

"%ProgramFiles%\Sublime Text 3\sublime_text.exe" "%1"
"%ProgramFiles(x86)%\Notepad++\notepad++.exe" "%1"
"%ProgramFiles%\Notepad++\notepad++.exe" "%1"
 %ProgramFiles%{insert-path-to-fave-editor}" "%1"

The OP also says replace this one as well. I did not and it works fine, but I also tried replacing it and it did not replace the association so I have no clue what it does so, here it sits for reference.

Computer\HKEY_CLASSES_ROOT\SystemFileAssociations\text\shell\open\command
2
  • 1
    lol. Here I am 8 months later, needing this setting and would you look at that. I was the one to post the solution. Nice.
    – SuperMar1o
    Apr 15, 2021 at 13:52
  • Another year and a half later, here I am. If you are on windows 11 and this is NOT working, it is because of the new W11 Notepad2. Just go to programs and uninstall Notepad.. Idk how to make them both work together, but this fixed it.
    – SuperMar1o
    Dec 12, 2022 at 17:00

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .