0

I would like to be able to right-click on a .cmd file in win10 (or windows server 2019), choose edit and have notepad++ open the file. I have a mixture of file types (as in 'nix text files) that are accessed this way in a windows interface, hence the use of notepad++. Life was simpler when I could just do the same with .cmd files, literally decades ago with another text editor. I've recently had a shift in my working environment, and find myself working in windows again.

So, please don't post an "answer" that I should just look further down the context menu for Edit with Notepad++. Clearly I need to refresh my knowledge of the newish nooks and crannies buried in the registry (which have definitely changed since last I looked).

| |
0

Just because I could not find a direct answer on stack exchange, and because there are so many low-quality answers that pop up elsewhere, and also so I don't have to waste so much time looking again for this again (note there are several embedded assumptions here, so this is only a hint):

open regedit as admin.

navigate to:

HKEY_CLASSES_ROOT\cmdfile\shell\edit\command

replace %SystemRoot%\System32\NOTEPAD.EXE %1

with "C:\Program Files\Notepad++\notepad++.exe" %1

exit and test.

or save this as a .reg file and merge it:

Windows Registry Editor Version 5.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,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,25,00,31,00,00,00

This was actually tested on server 2019

| |
  • Please have a look at Can I answer my own question? and come back two days later and check as answered. – help-info.de Jul 7 at 8:02
  • unlikely, but if the stars align correctly, I'll accept my own answer. – BISI Jul 7 at 15:08

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.