Keeping Original File Properties

From Notepad++ Wiki
Jump to: navigation, search
Associating file types with Notepad++ without losing their particular specificities (icons, right click items,...)


Associating various file types with Notepad++ is certainly a good idea, and allows uniform treatment of files across various different applications or systems.

However, by doing so, all files are regarded by Windows as being of a common type, associated with Notepad++. In particular, they lose their own icon and perhaps some context menu items.

The following howto has been posted on Help and claims to restore the loss. Adapt to your own set of file extensions to manage.


Run regedit, export HKEY_CLASSES_ROOT\Notepad++_file and edit the .reg file according to your preferences. See the example below.

This was the original .reg file Windows Registry Editor Version 5.00

[HKEY_CLASSES_ROOT\Notepad++_file] @="Notepad++ Document" "EditFlags"=hex:00,00,00,00

[HKEY_CLASSES_ROOT\Notepad++_file\DefaultIcon] @="\"C:\\Program Files\\Notepad++\\notepad++.exe\",0"

[HKEY_CLASSES_ROOT\Notepad++_file\shell]

[HKEY_CLASSES_ROOT\Notepad++_file\shell\Edit] @="&Edit"

[HKEY_CLASSES_ROOT\Notepad++_file\shell\Edit\command] @="\"C:\\Program Files\\Microsoft Office\\Office12\\msohtmed.exe\" %1"

[HKEY_CLASSES_ROOT\Notepad++_file\shell\open]

[HKEY_CLASSES_ROOT\Notepad++_file\shell\open\command] @="\"C:\\Program Files\\Notepad++\\notepad++.exe\" \"%1\""

[HKEY_CLASSES_ROOT\Notepad++_file\shell\Print] @="&Print"

[HKEY_CLASSES_ROOT\Notepad++_file\shell\Print\command] @="\"C:\\Program Files\\Microsoft Office\\Office12\\msohtmed.exe\" /p %1"

[HKEY_CLASSES_ROOT\Notepad++_file\ShellEx]

[HKEY_CLASSES_ROOT\Notepad++_file\ShellEx\IconHandler] @="{42042206-2D85-11D3-8CFF-005004838597}"

I replaced "Notepad++_file" with "Notepad++_php" and "Notepad++ Document" with "PHP". The new file looked like this:

Windows Registry Editor Version 5.00

[HKEY_CLASSES_ROOT\Notepad++_php] @="PHP" "EditFlags"=hex:00,00,00,00

[HKEY_CLASSES_ROOT\Notepad++_php\DefaultIcon] @="\"C:\\Program Files\\Notepad++\\notepad++.exe\",0"

[HKEY_CLASSES_ROOT\Notepad++_php\shell]

[HKEY_CLASSES_ROOT\Notepad++_php\shell\Edit] @="&Edit"

[HKEY_CLASSES_ROOT\Notepad++_php\shell\Edit\command] @="\"C:\\Program Files\\Microsoft Office\\Office12\\msohtmed.exe\" %1"

[HKEY_CLASSES_ROOT\Notepad++_php\shell\open]

[HKEY_CLASSES_ROOT\Notepad++_php\shell\open\command] @="\"C:\\Program Files\\Notepad++\\notepad++.exe\" \"%1\""

[HKEY_CLASSES_ROOT\Notepad++_php\shell\Print] @="&Print"

[HKEY_CLASSES_ROOT\Notepad++_php\shell\Print\command] @="\"C:\\Program Files\\Microsoft Office\\Office12\\msohtmed.exe\" /p %1"

[HKEY_CLASSES_ROOT\Notepad++_php\ShellEx]

[HKEY_CLASSES_ROOT\Notepad++_php\ShellEx\IconHandler] @="{42042206-2D85-11D3-8CFF-005004838597}"

I then merged the new file into the registry. After the merge I had 2 keys in the registry, the original one ([HKEY_CLASSES_ROOT\Notepad++_file]) and the new one ([HKEY_CLASSES_ROOT\Notepad++_php]).

The next step was to associate the .php files with the new file type that I had created. I used a freeware application named FileTypesMan which can be downloaded from this location: http://www.nirsoft.net/utils/file_types_manager.html