7

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?

5

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.

  • 1
    It worked perfectly. The program doesn't even need to be installed. I don't like opening PDF files with Edge and since I used Chrome for everything I set Chrome to open PDF but I wanted PDFs to have the adobe red logo instead of the Chrome logo. This made it very simple. Tks +1 – DGaleano Jan 13 '17 at 15:42
  • Needed it for exactly the same reason :) Works perfectly for me on Windows 10 – Elena Feb 25 '17 at 11:26
  • @DGaleano I want to do about the same thing. I want to open both .html and .pdf files with Google Chrome but I want the .pdf icon to show up differently. Cannot figure out how to do that with the "Default Programs Editor". It shows pdf, htm as one set of files to be opened by chrome. So icon changes for both. Any hints? – curious_cat May 14 '18 at 5:23
4

You can refer to this MSDN article

  1. Create a Sub Key named DefaultIcon in HKEY_CLASSES_ROOT\.extension

  2. 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.

  3. 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  

  • I am following the advice prior to the edit (adjusting the registry setting for the filetype) and it isn't changing the icon. Is there something I should be doing in the registry for the application as well? – Sam Aug 21 '15 at 13:11
  • @Sam you need to logoff and log back in to see your changes – Rithvik Vibhu Aug 22 '15 at 1:33
  • I did logoff and log back in. Still not working. Perhaps it is being "over-ridden" by the icon assigned to the application that opens those file types? – Sam Aug 22 '15 at 15:22
  • 2
    Further info the method above DOES work for an arbitrary file type NOT already associated with a program (and hence an icon). I got the steps to work for the (relatively obscure) ".arj" format. However, I need to get it to work with ".md" file format which has a specific exe assigned to it. – Sam Aug 22 '15 at 15:33
  • @Sam same issue here. Trying to fix Adobe Illustrator's SVG file icon on WIndows, but it doesn't work when the SVG file type is actually associated to Illustrator. Very frustrating. – JacobTheDev Oct 10 '17 at 19:40
1

This is pretty difficult, and for very interesting reasons.

Since Windows Vista, file types are mostly managed by the "User Choice" option (as can be seen from the FileTypesMan interface), which bundles the program, icon, menu options etc. into one file type such as "ChromeHTML". Back then we can simply create a new file type, and the modify the User Choice option of a given file extension to the new type, but now things are different. Since Windows 8, the system introduces a "hash" to the User Choice option, which is basically a password that protects the file extension from being modified by anyone other than the system UI. Pretty much all file type managing tools, including FileTypesMan and Default Programs Editor, couldn't break that password, and therefore can't help you change the User Choice.

There's only one exception that I'm aware of. It's called SetUserFTA. The author of the tool somehow reverse-engineered the system and figured out the exactly algorithm used to create the hash, and therefore can indeed change User Choice for a single file extension without altering anything else. The tool can be downloaded from

https://kolbi.cz/blog/2017/10/25/setuserfta-userchoice-hash-defeated-set-file-type-associations-per-user/

So now all you need to do is to create a new file type as in the old days, and use SetUserFTA to change the extension.

  • 1
    I am very hesitant to issue an upvote to this answer, but I did, if you find other questions please just flag the questions as a duplicate instead of submitting multiple identical answers that recommend this application. – Ramhound Jan 23 at 10:16
  • My apologies if this answer had been provided before, but it certainly took myself a long while to find it. As I Google the subject, this page come out near the top, so I suppose it will benefit others if I just post the answer here. – Mu-Tsun Tsai Jan 25 at 0:02
0

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"
  • 1
    This isn't working for me... I have .txt pointing to txtfile, and txtfile has DefaultIcon set to "%SystemRoot%\system32\imageres.dll,-102", but the icon for Notepad++ is still displayed on my text files because that's the program I chose for opening. I think DefaultIcon means "the icon we use if there is no program assigned". – David Grayson Jun 4 '16 at 4:15
  • This happens if Default Programs or Open with was used for associating file types. This article should help in that case, covers both aspects. How to Change the Default Icon for a File Type in Windows? - or you can try FileTypesMan from Nirsoft. – Win32Guy Jun 4 '16 at 5:12
-1

I just went through this and thought I'd share my specific solution. I like to use Chrome to view PDF files but hated that all PDF files looked like Chrome web pages, or Edge web pages! I made two changes to the registry although I don't believe the .pdf registry change was necessary.

Right click, run Regedit as an administrator and add the two keys as below:

HKEY_CLASSES_ROOT>.pdf>
      (Default) = pdf_auto_file   [Locate this program name for step 2]
      DefaultIcon       [added this key to the .pdf]
         (Default) = C:\Windows\system32\shell32.dll,75 [set the value of DefaultIcon]


HKEY_CLASSES_ROOT>
   pdf_auto_file>
      DefaultIcon       [add the DefaultIcon key to pdf_auto_file]
         (Default) = C:\Windows\system32\shell32.dll,75  [set the value of DefaultIcon]

I used a shareware program called IconExplorer to locate the icon I liked and get the correct path.

  • Why was this answer downvoted? It seems quite reasonable. – Jens Ehrich Dec 10 '16 at 23:23

Your Answer

By clicking "Post Your Answer", you acknowledge that you have read our updated terms of service, privacy policy and cookie policy, and that your continued use of the website is subject to these policies.

Not the answer you're looking for? Browse other questions tagged or ask your own question.