The Computer Oracle

How to make notepad++ the default editor for a Windows batch file?

--------------------------------------------------
Become or hire the top 3% of the developers on Toptal https://topt.al/25cXVn
--------------------------------------------------

Music by Eric Matyas
https://www.soundimage.org
Track title: Lost Meadow

--

Chapters
00:00 Question
00:46 Accepted answer (Score 34)
01:50 Answer 2 (Score 2)
02:09 Thank you

--

Full question
https://superuser.com/questions/728152/h...

Question links:
[How do I set Notepad++ as the default editor?]: https://superuser.com/q/474079/91054

--

Content licensed under CC BY-SA
https://meta.stackexchange.com/help/lice...

--

Tags
#windows #notepad++

#avk47



ACCEPTED ANSWER

Score 36


Change the program associated to the "Edit" verb for batch files:

  • Run RegEdit (as admin)
  • Navigate to HKEY_CLASSES_ROOT\batfile\shell\edit\command.
  • Modify the Default and change Value Data from %SystemRoot%\System32\NOTEPAD.EXE %1 to "C:\Program Files (x86)\Notepad++\notepad++.exe" "%1"
  • Close RegEdit.
  • Right-click -> "Edit" should now open batch files in NotePad++.

Note: You may have to adjust your path to Notepad++.exe if it resides in a different folder on your system.

Also note: This is a system-wide change.




ANSWER 2

Score 2


If there are spaces in the filename being edited then double-quotes (") can be used to surround the argument. For example:

"C:\Program Files (x86)\Notepad++\notepad++.exe" "%1"