The Computer Oracle

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

--------------------------------------------------
Hire the world's top talent on demand or became one of them at Toptal: https://topt.al/25cXVn
and get $2,000 discount on your first invoice
--------------------------------------------------

Music by Eric Matyas
https://www.soundimage.org
Track title: Underwater World

--

Chapters
00:00 How To Make Notepad++ The Default Editor For A Windows Batch File?
00:33 Accepted Answer Score 36
01:25 Answer 2 Score 2
01:37 Thank you

--

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

--

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"