How to launch a program from Notepad++

notepad

Some text editors, like Notepad2, have the ability to run the file that's being edited. Can this be done with Notepad++?

Best Answer

First close Notepad++, then find the file shortcuts.xml, usually in:

  • Windows 7/8/10: C:\Users\<username>\AppData\Roaming\Notepad++
  • Windows XP: C:\Documents and Settings\<username>\Application Data\Notepad++

Open it up with something other than Notepad++ (perhaps notepad.exe) and add something like this to the file within the <UserDefinedCommands></UserDefinedCommands> tags:

<Command name="Launch file" Ctrl="yes" Alt="yes" Shift="yes" Key="">&quot;$(FULL_CURRENT_PATH)&quot;</Command>

That will launch the (saved) file with its default application.

Save the changes and then load up Notepad++ to see your new entries in the Run menu.

Important: do not edit shortcuts.xml with Notepad++ itself as the shortcuts.xml file is overwritten when the program shuts down (overwriting any changes you made).

Related Question