0

Is it possible to hide the 'Edit with Notepad++' context-menu option when right-clicking certain file types?

To clarify, I want to keep the edit option for text-based filetypes like .txt, .ini, and .java. I'm not looking to remove or disable the shell integration. I instead want to hide the option for certain filetypes (e.g. photos, music, videos).

Edit option appearing on

0

Download Notepad++ standalone executable as a 7zip or Zip file from this repository https://notepad-plus-plus.org/repository/. Now extract the compressed file and you are ready to run Notepad++. e.g. Here URL for version 7.0;

Remove the shell integration, open cmd.exe and cd to your installation folder. At this point, and Notepad++ being closed, enter with command regsvr32 /u NppShell.dll. See more:: Adding Notepad++ to the context menu.

To add context menu for all file types use this registry script. Say Notepad++ executable is saved in "E:\Notepad".

[HKEY_CLASSES_ROOT\*\shell\Notepad++] "Extended"="" [HKEY_CLASSES_ROOT\*\shell\Notepad++\command] @="\"E:\\Notepad\\notepad++.exe\" \"%1\""

Note that the extended value will hide the context menu and show only when you press shift key and right click. Alternatively you can create a file type and associate any extension as you want, with this command::

ftype NotepadPlus="E:\Notepad\notepad++.exe" "%1" assoc .txt=NotepadPlus

0

The Edit with Notepad++ option is provided by a shell extension that's registered for all file types by default. I don't think you can't hide it for specific file types without editing the shell extension itself. Instead, you can remove the registration for all file types and add it only to the file types you want.

First, export the key HKEY_CLASSES_ROOT\*\shellex\ContextMenuHandlers\ANotepad++ (32-bit) or HKEY_CLASSES_ROOT\*\shellex\ContextMenuHandlers\ANotepad++64 (64-bit) to a .reg file. For reference, here's what it looks like on a 64-bit system:

Windows Registry Editor Version 5.00

[HKEY_CLASSES_ROOT\*\shellex\ContextMenuHandlers\ANotepad++64]
@="{B298D29A-A6ED-11DE-BA8C-A68E55D89593}"

Then, delete that key. This will immediately remove the Edit with Notepad++ option on all files.

Finally, copy the .reg file, replace * with a file type you want the Edit with Notepad++ option on. This must be the file type class, not the file extension; you can find the file type class by looking at the default value on the key for the file extension (though it may be overridden by a user preference in HKEY_CURRENT_USER\SOFTWARE\Microsoft\Windows\CurrentVersion\Explorer\FileExts). For example, for .txt, this is txtfile by default. You can also copy the section and specify a different file type for each, then import the new .reg file to the registry, and you should see the Edit with Notepad++ option only on the file types you specified.

Windows Registry Editor Version 5.00

[HKEY_CLASSES_ROOT\txtfile\shellex\ContextMenuHandlers\ANotepad++64]
@="{B298D29A-A6ED-11DE-BA8C-A68E55D89593}"

[HKEY_CLASSES_ROOT\inifile\shellex\ContextMenuHandlers\ANotepad++64]
@="{B298D29A-A6ED-11DE-BA8C-A68E55D89593}"

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.