In Settings/Preferences, Notepad++ has an option on the MISC. tab under 'Clickable Link Settings' to the right, to Enable to open links found in the edited files. It underlines them and opens them on double-click. I've tried it with the file:/// protocol and it works, but it actually executes them according to whatever file-association I have set in Windows.

Is there a way, a protocol, or a way to "make" a (local) protocol, such that Notepad++ opens any kind of files (any extension), from these links in the document, in Notepad++ itself? (ie in another tab)

  • This is quite a late response... So you don't want to change your default editor to be Notepad++, you just want to enable links that are inside Notepad++ to remain in there when you open them? – Jon Aug 14 '13 at 15:39
  • @Jon yes, as you say! As an extra, even better if I can select which kind (protocol) of links to open internally (n++) and externally (OS). So I could select that only file:// links to open in n++. – n611x007 Aug 14 '13 at 18:52
  • 1
    I guess that would require a plugin to do that. Scanned through Directory for Notepad++ plugins but didn't spot anything like it, only the Explorer plugin which promises to open any file that is clicked in Npp. – zagrimsan Aug 15 '13 at 9:07
  • For anyone out there as dum as me: I could not get this to work with file:// links. It is because I was trying "file://C:\SomeFolder\SomeFile.txt". It worked when switched it to "file://C:/SomeFolder/SomeFile.txt" – Rob3C Feb 24 '16 at 12:30
  • Remember to use %20 as replacement for a space in the link, e.g. file://C:/Some%20Folder/Some%20File.txt. It also works if you leave the backslash \ in the path as long as you have the protocol right: file://C:\Some%20Folder\Some%20File.txt. – Thomas H. Schmidt Jan 25 '18 at 9:58

file:// is an intrinsic protocol of Windows, so if you want to ignore the "whatever file-association [is] set in Windows," i'd suggest you use a dedicated protocol, say npp://. Then add this to your registry (using the corresponding path on your system):

@="URL: NotePad++ Protocol"
"URL Protocol"=""

@="\"C:\\Program Files\\Notepad++\\notepad++.exe\""



@="\"C:\\Program Files\\Notepad++\\notepad++.exe\" \"%1\""
| improve this answer | |
  • 1
    superb tip & funny results :D. depending on the path separator and number of directories I use, N++/windows behaves very differently (sometimes opening a folder in explorer?!), most combinations not working. Also I escaped \"%1\" in the .reg file. – n611x007 Sep 5 '13 at 21:15
  • Point taken. :"> I've corrected it myself now, but i think you could've done it yourself, considering it's a bugfix. ; As for the inconsistent results, the programmer in me would like to suggest that you make a test app that highlights whatever it is that windows is passing to it as args[0]... :D – C.B. Sep 5 '13 at 23:57
  • Does not work on my Win10. (With or without corrections for "(x86)" in the file path.) I guess I'd also need the workaround that Luke describes in his answer. – StackzOfZtuff Jun 28 '16 at 7:48

The given answer did not work for my Windows 7 Pro system. The parameter %1 was never (correctly) provided to NotePad++ and it started with an empty new file.

However instead I started a batch file through @=c:\soft\start-notepad.bat "%1" In this batch file I stripped off the NPP:/// prefix from %1 and replaced / with \ inside of %1. From this batch file the start of NotePad++ with the modified parameter %1 does work perfectly. Here is the short batch file code:


set note=insert here the path to notepad++.exe
set para1=%1%
set para1=!para1:edit:///=!
set para1=!para1:/=\!
%note% %para1%

The quotation marks "%1" around %1 are not really necessary, because paths or filenames with spaces or special symbols will anyhow result in broken hyperlinks in Notepad++.

If necessary this has to be corrected in NotePad++ with e.g. %20 for the "space", otherwise the hyperlinking of link NPP:///c:/path/file name.txt will stop after file.

| improve this answer | |

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.