2

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
9

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

[HKEY_CLASSES_ROOT\SystemFileAssociations\text\shell\edit\command] 
0
0

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" (x86)
"%ProgramFiles%\Notepad++\notepad++.exe" "%1" (x64)
 %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
1
  • 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 at 13:52

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.