How to change the icon associated with a particular file format (and only that file format) on Windows 10?
Currently I have associated various text file formats (.md, .txt, .taskpaper) to be opened by sublime text. This results in ALL of them being assigned the SAME icon file, namely the sublime text icon.
How can I get each file format to have its own unique icon file (supplied by me)?
First Attempt
Change the icon associated with one of the file types using FileManType by Nirsoft. The Result: it changes the icon for ALL of the file types that sublime opens (not what I wanted)
Second Attempt
Now I tried to get clever...
- (1) created a shortcut of the sublime exe for each file format
- (2) gave each shortcut its own unique icon, which the shortcut accepted
- (3) set the program that (say) .md files opened with to its own special shortcut etc...
This time it just ignored the icons contained in the shortcuts and remained with the sublime icon
Any ideas?
Use Default Programs Editor.
Among other things, this editor allows you to replace the icon for a single file type while still retaining the associated program.
I realize this is basically a link only answer, however, I'm not aware of any other way to do this without direct registry editing. If you're interested in the specific edits that need to be made, consider using procmon
from Sysinternals to capture the registry activity during an icon change.
You may be able to download version 2.7.2675.2253 of the Default Programs Editor (from Friday, February 15, 2013) at Chocolatey Gallery.
You can refer to this MSDN article
Create a Sub Key named DefaultIcon in
HKEY_CLASSES_ROOT\.extension
Assign the DefaultIcon Sub Key a default value of type
REG_SZ
that specifies the fully qualified path for the file that contains the icon.Logoff and log back in
EDIT: it looks like the Windows 10 registry has separate entries for each app, so for instance I wanted to change my Notepad++ .ico, so I found the HKEY_CLASSES_ROOT\Notepad++_file
entry and modified the existing DefaultIcon path. Forgot to add this. Its one of the comments
If multiple file extensions are mapped to the same ProgId, the same icon will be used. If you need different icons for different file types/extensions, assign different ProgId names, setting the same application for the "open" verb.
For example:
Make .md point to sublime_md
Make .txt point to sublime_txt
and so forth... It becomes tedious only if you create hundreds of those custom files types.
And the program that's assigned for these ProgIds (sublime_txt, sublime_md and sublime) are exactly the same, differing only in the "DefaultIcon" value.
HKCR\sublime_txt\DefaultIcon Set default vlaue to "path:\texticon.dll"
HKCR\sublime_md\DefaultIcon Set default vlaue to "path:\mdicon.dll"
To better explain using a sample REG file:
Windows Registry Editor Version 5.00
;For .md extension
;-----------------
[HKEY_CLASSES_ROOT\.md]
@="sublime_md"
[HKEY_CLASSES_ROOT\sublime_md\DefaultIcon]
@="c:\\mdicon.dll"
[HKEY_CLASSES_ROOT\sublime_md\shell\open]
@="Open"
[HKEY_CLASSES_ROOT\sublime_md\shell\open\command]
@="c:\\sublime.exe %1"
;For taskpaper extension
;-----------------------
[HKEY_CLASSES_ROOT\.taskpaper]
@="sublime_task"
[HKEY_CLASSES_ROOT\sublime_task\DefaultIcon]
@="c:\\taskicon.dll"
[HKEY_CLASSES_ROOT\sublime_task\shell\open]
@="Open"
[HKEY_CLASSES_ROOT\sublime_task\shell\open\command]
@="c:\\sublime.exe %1"