@mapsonx said in Make notrepad++ default:
I read the info here Shell Extension, and here Replacing Notepad with Notepad++ in Windows 10, but I’m a bit anxious about it.
User Manual > Other Resources > Notepad Replacement gives a fuller explanation than some random gist
I’ve been using the portableapps version.
shudder
I’ve had a few issues lately with some other portableapps wiping out profiles.
Considering that they modify the binaries without publishing the codebase changes, in violations of the open source license of the software they “distribute”, you’re lucky if losing a profile is all that happens.
I don’t want that happening with Notepad++, so I want to switch to the regular potable version I just downloaded from here Download Notepad++ v8.9.3.
Good idea.
That said, I need to make Notepad++ the system default.
It seems a mixed bag: wanting it as system default, associated with lots of file types, and using the Shell Extension, but not wanting to “install” it. It might help us give you better advice if you explain what parts of the “install” that you are opposed to. Is it just storing the settings in %AppData% that you don’t like? Or is there something else? The installer can install into any directory, not just Program Files; the installer can choose to not use %AppData% (as long as it’s not installed in Program Files); the installer automatically registers the Shell Extension for you.
That’s when learned it is not simply a matter of doing it in Settings > Preferences > FIle Associations.
So, it seems my only alternative is “Choose default apps by file type”??
You can start with the Settings > Preferences > File Associations. But that uses the ancient method of file association, and modern Windows 11 actively fights against those old-style associations.
Open With is Windows’ preferred method, because they want to make sure it’s the user, not an over-aggressive installer, that is choosing the default app (and that’s something I applaud them for).
If you’ve done at least one Open With, then your registry should have an HKEY_CURRENT_USER\Software\Classes\Applications\notepad++.exe “key”. On that key, if you right-click and do a new key as a subkey on it, to create SupportedTypes as HKEY_CURRENT_USER\Software\Classes\Applications\notepad++.exe\SupportedTypes. Inside that, you can do new string values, where the left side is .ext (for whatever extension) and the right side is empty. Windows uses this as the way to hear an app say, “I want to handle this type”, and it helps Windows prioritize the app in the Open With and other things.
For the individual file-type extensions, Windows stores them in HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Explorer\FileExts\.XXX\UserChoice (for example, .txt for the .XXX location), in the ProgId=“Applications\notepad++.exe” value. So, if you created a registry file like
Windows Registry Editor Version 5.00
[HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Explorer\FileExts\.txt\UserChoice]
"ProgId"="Applications\\notepad++.exe"
[HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Explorer\FileExts\.123\UserChoice]
"ProgId"="Applications\\notepad++.exe"
[HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Explorer\FileExts\.456\UserChoice]
"ProgId"="Applications\\notepad++.exe"
and ran that file, it would try to set the chosen application for each of those extensions (.txt, .123, and .456) to use Notepad++. (You would, of course, have to edit that file to have all the extensions that you wanted to choose, and to not use the .123 and .456 dummy extensions). But, again, I think Windows OS notices when someone tries to do that, and it might require you to confirm the choice the first time you double-click on such a file.
caveat: playing with the registry, through regedit or running .reg files you find on the internet, can bork your system. these are examples that I believe are safe, but you are responsible for your own system.
I extracted NppShell.dll, but I suppose in this scenario I won’t be using it.
I guess I’m confused. I thought, by your first sentence, that you wanted to use it. Do you want an Edit with Notepad++ entry in the right-click context menu for every file type, whether or not it’s associated with Notepad++? If so, then register NppShell.dll. If not, then I’m not sure why you brought it up at all.
Personally, I find that the right-click version is the easiest way for opening files that don’t default to Notepad++ (for example, editing a .bat, since you don’t want to double-click on a batch file to edit it, since that should be reserved for running it). So whether you choose to use the installer, or manually register it in the portable version, I would definitely recommend using the Shell Extension.
I also need some advice transferring all settings from portableapps.
copy the config.xml and similar XML files . The User Manual > Upgrading > Upgrading a portable edition talks about the critical and less-critical files for getting settings ported over from one portable to another.