It’s surprising that Windows doesn’t have a built-in option to allow users set custom icons for file types. There are 3rd party tools like FileTypesMan and Default Programs Editor that can change the file type icons and association settings; but this post tells you how to do it using the Registry Editor.
Change Icon for a File Type Using Registry Editor
Let’s assume you want to change the file type icon for .txt files, and here is how to do that.
- Click Start, type
regedit.exeand press ENTER
- Navigate to the following branch:
- In the right-pane, note down the value data for
txtfile). This is the user chosen (via Default Programs or Open with dialog) Programmatic Identifier for the file extension.
Registry Branch Not Found?
- If the
UserChoicebranch does not exist, navigate to the following branch:
- In the right-pane, note down the
(default)value data (e.g.
- Navigate to the following key (where
txtfileis the Prog ID noted in Step 2 or Step 4 above)
DefaultIconkey does not exist by default, you need to create it manually.
- In the right-pane, double-click
(default)and mention the path to your custom icon (.ico file or reference to a icon inside a EXE/DLL file. See “Icons From DLL/EXE Files” paragraph at the end of this article).
- Edit the
(default)value data, mentioning the path to a icon file. For this example, I used a notepad icon file from the web, saved it to a permanent location and mentioned the full path.
If you’re using a custom icon file, make sure it’s at least 128 x 128, although it’s not a rule but this is to make sure icons look nice when folder view is set to large or extra large icons.
- Exit the Registry Editor.
- Logoff and login back, or refresh the icons and see if the Text file icons are now updated.
Icons From DLL/EXE Files
If you don’t have a custom .ico file, you may use the icon picker dialog box to choose an icon from a EXE/DLL file. To launch the icon picker dialog, right-click on a folder in your system, click Properties. Click the Customize tab, and click Change Icon… button. Use the icon picker to choose the icon and make a note of the index. The index starts from “0” and you need to proceed vertically when counting (top to bottom.)
imageres.dll and note down the icon index, simply cancel the icon picker dialog and close folder properties dialog.
For example, to set the
260th icon in Shell32.dll, mention the following path, in Step 8:
To make it clear, this procedure doesn’t change the file type associations, only the icon assigned to that file type. If the icons don’t update even if you restart Windows, clear and rebuild the icon cache.
About the author
Ramesh Srinivasan founded Winhelponline.com back in 2005. He is passionate about Microsoft technologies and has a vast experience in the ITeS industry — delivering support for Microsoft's consumer products. He has been a Microsoft MVP [2003 to 2012] who contributes to various Windows support forums.