As noted elsewhere on this thread, it is very handy to have a "Edit with Notepad++" context menu item when right-clicking on file names. However, 2 problems can come up when using Notepad++ from a USB device when away from your "main" Notepad++ installation:
1. You cannot control or predict the drive letter that will be assigned to the USB device.
2. You may not have permission to patch the HKEY_CLASSES_ROOT hive of the Registry on the host machine.
The following batch file determines the drive letter of the batch file and patches the equivalent Registry key in the HKEY_CURRENT_USER hive (where all users have write access). The pause at the end keeps the console window open so you can see the success or failure message. Note that reg.exe is not available on Windows 2000. Change the path in the "set NPP=..." line as applicable.
@echo off
REM absolute path to notepad++.exe using drive letter of this batch file
set NPP=%~d0\Util\Notepad++\notepad++.exe
You need to add a couple of quotes... Save the following block of text to a .reg file and import it with regedit. You might need to edit it if you have NP++ installed in a non-standard location, or aren't using an english windows version.
Windows Registry Editor Version 5.00
[HKEY_CLASSES_ROOT\*\Shell\Notepad++]
[HKEY_CLASSES_ROOT\*\Shell\Notepad++\Command]
@="\"C:\\Program Files\\Notepad++\\Notepad++.exe\" \"%1\""
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
I've installed Notepad plus 4.0.2 with the explorer context menu option enabled. The context menu option "Edit with Notepad++" appears for almost all file types and works great, but it doesn't appear for .url files. Anybody know how I can get "Edit with Notepad++" to appear when I right click .url files?
Thanks!
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
Something like the followng .reg file seems to work. Of course, change your path to Notepad++ as applicable, and change the context menu prompt string as desired. Note that you should already have a HKCR\InternetShortcut\shell key with open, print, and printto sub-keys; you will be adding a shell key similar to the HKCR\*\shell key described elsewhere in this thread. Note also that this is on a system where Firefox is the default browser.
Windows Registry Editor Version 5.00
[HKEY_CLASSES_ROOT\InternetShortcut\shell\Notepad++]
@="Edit with Notepad++"
[HKEY_CLASSES_ROOT\InternetShortcut\shell\Notepad++\command]
@="D:\\Notepad++\\Notepad++.exe \"%1\""
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
While we're waiting for someone to tell us how to do this right, there's a workaround - drop a shortcut to N++ at C:\Documents and Settings\<your ID>\SendTo and then use the N++ under Send To on the context menu. Not as slick but it works.
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
Here's the solution:
in the registry, in HKEY_CLASSES_ROOT, under key named *, create key named shell if it's not already there. Under key named shell, create key named NP++ (or whatever you want to be in the context menu). Under key named NP++, create key named Command. Set the default Value under Command to this exactly:
"C:\Program Files\Notepad++\notepad++.exe" %1
Have a care. Changing the wrong thing in the registry can make you sad.
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
a "open with N++" line in Windows(Explorer)'s context menu will be so nice... and appreciated.
As noted elsewhere on this thread, it is very handy to have a "Edit with Notepad++" context menu item when right-clicking on file names. However, 2 problems can come up when using Notepad++ from a USB device when away from your "main" Notepad++ installation:
1. You cannot control or predict the drive letter that will be assigned to the USB device.
2. You may not have permission to patch the HKEY_CLASSES_ROOT hive of the Registry on the host machine.
The following batch file determines the drive letter of the batch file and patches the equivalent Registry key in the HKEY_CURRENT_USER hive (where all users have write access). The pause at the end keeps the console window open so you can see the success or failure message. Note that reg.exe is not available on Windows 2000. Change the path in the "set NPP=..." line as applicable.
@echo off
REM absolute path to notepad++.exe using drive letter of this batch file
set NPP=%~d0\Util\Notepad++\notepad++.exe
reg add HKCU\Software\Classes\^*\shell\Notepad++ /f /ve /d "Edit with Notepad++"
reg add HKCU\Software\Classes\^*\shell\Notepad++\command /f /ve /d "%NPP% ""%%1"""
pause
N++ used to do this!! I've been looking - it's something like setting HKCR/*/shell/n++/command to C:\Program Files\Notepad++\notepad++.exe %1
--but that's not quite right. If anyone knows the right way, I'd be thankful (peter.buck@eds.com)
You need to add a couple of quotes... Save the following block of text to a .reg file and import it with regedit. You might need to edit it if you have NP++ installed in a non-standard location, or aren't using an english windows version.
Windows Registry Editor Version 5.00
[HKEY_CLASSES_ROOT\*\Shell\Notepad++]
[HKEY_CLASSES_ROOT\*\Shell\Notepad++\Command]
@="\"C:\\Program Files\\Notepad++\\Notepad++.exe\" \"%1\""
awesome, works in vista, thank you!!
Hello,
I've installed Notepad plus 4.0.2 with the explorer context menu option enabled. The context menu option "Edit with Notepad++" appears for almost all file types and works great, but it doesn't appear for .url files. Anybody know how I can get "Edit with Notepad++" to appear when I right click .url files?
Thanks!
Something like the followng .reg file seems to work. Of course, change your path to Notepad++ as applicable, and change the context menu prompt string as desired. Note that you should already have a HKCR\InternetShortcut\shell key with open, print, and printto sub-keys; you will be adding a shell key similar to the HKCR\*\shell key described elsewhere in this thread. Note also that this is on a system where Firefox is the default browser.
Windows Registry Editor Version 5.00
[HKEY_CLASSES_ROOT\InternetShortcut\shell\Notepad++]
@="Edit with Notepad++"
[HKEY_CLASSES_ROOT\InternetShortcut\shell\Notepad++\command]
@="D:\\Notepad++\\Notepad++.exe \"%1\""
While we're waiting for someone to tell us how to do this right, there's a workaround - drop a shortcut to N++ at C:\Documents and Settings\<your ID>\SendTo and then use the N++ under Send To on the context menu. Not as slick but it works.
Here's the solution:
in the registry, in HKEY_CLASSES_ROOT, under key named *, create key named shell if it's not already there. Under key named shell, create key named NP++ (or whatever you want to be in the context menu). Under key named NP++, create key named Command. Set the default Value under Command to this exactly:
"C:\Program Files\Notepad++\notepad++.exe" %1
Have a care. Changing the wrong thing in the registry can make you sad.
You need quotes around %1, otherwise you will have problems when opening multiple files with spaces in their pathnames.
Yep! I works fine. Thanks a lot, f0dder! :)