Where are the folder icons generated with the folder properties kept in the Registry?

2

Right click on a folder and select properties. Select the "Customize"tab. At the bottom select "Change Icon" etc

Works very nicely. My question is: Where is this information held in the registry?

Pablo678

Posted 2013-12-02T21:35:49.663

Reputation: 135

Answers

1

Information about icons for special objects (like Recycle Bin or My Computer) and classes of objects (e.g., file types) is stored in the registry.  Information about icons for individual objects is usually stored with the object.  In particular, when you assign a custom icon to a folder through the “Customize” tab of the “Properties” window is stored in a DESKTOP.INI file in the folder.  It has the Hidden and System attributes set, so you won’t see it unless you go hunting for it.  Specifically, Windows will write lines like this:

[.ShellClassInfo]
IconResource=C:\Windows\system32\SHELL32.dll,60

into the DESKTOP.INI file.

Scott

Posted 2013-12-02T21:35:49.663

Reputation: 17 653

Thank you for your reply. Even although I had set "Show hidden files and folders" in the folders option of the control panel, the desktop.ini files did not show up. In desperation I ran <ATTRIB -R -H -S C:\desktop.ini /S /D> at the command prompt. Lo and behold the desktop.ini files all turned up. So you're quite right and thank you for correcting my misconception. – Pablo678 – 2013-12-03T01:49:38.090

Clearing the “Hide protected operating system files (Recommended)” option will, as you might imagine, show “System” files. But as long as you’re using Command Prompt, try dir /a. – Scott – 2013-12-03T02:41:57.867

@Pablo678 Ok, I am irritated. What have I missed in my answer two hours earlier which is in this one? – nixda – 2013-12-03T10:18:14.437

Sorry nixda, to have riled you. Your reply was indeed useful to me and I do appreciate the time you took. Unfortunately, only one answer can be marked as the one that solves the problem. I chose Scott's because he pointed out that the properties customization is equivalent to inserting a desktop.ini – Pablo678 – 2013-12-03T13:25:08.973

1

To find system icons

Those icons aren't stored in the registry, they are normally packed into .dll files. Note that .exe, .ocx, .icl, .ico are also valid icon files. The two most important files are:

C:\Windows\system32\imageres.dll
C:\Windows\system32\shell32.dll

There are more system icons hidden in:

C:\Windows\system32\compstui.dll
C:\Windows\system32\DDORes.dll
C:\Windows\system32\ieframe.dll
C:\Windows\system32\mmcndmgr.dll
C:\Windows\system32\moricons.dll
C:\Windows\system32\netshell.dll
C:\Windows\system32\pnidui.dll
C:\Windows\system32\wmploc.dll

Not all of them are available under Windows XP, only in Windows 7 and higher.

You can extract them to normal .ico files with tools like Nirsoft's ResourcesExtract


To assign system icons

A single .dll can contain multiple icons and each icon has its unique index within the dll. The information which .dll and which index should be used varies accordingly to the folder type

  1. Special folders like Recycle Bin or My Computer are saved in the registry under

    HKEY_CLASSES_ROOT\CLSID\{xxxx}\DefaultIcon
    (Default)
    %SystemRoot%\System32\imageres.dll,3
    

    {xxxx} must be replaced with the correct Windows Class Identifier. (click for full list)

    The ,3 means the folder in question should display the 3rd icon from imageres.dll

  2. Normal folders can be customized by creating a desktop.ini file within that folder. A typical file would look like:

    [.ShellClassInfo] 
    IconFile=%SystemRoot%\system32\imageres.dll
    IconIndex=3
    

nixda

Posted 2013-12-02T21:35:49.663

Reputation: 23 233

Thank you for that copious and useful reply. However ... that tells me where some of the windows icons are but not where the information is which associates the icon with the folder. Surely that must be somewhere in the register!? So, if I use the properties dialogue to associate one of my own icons with a folder then somehow Windows must know both the location of the icon as well as the location of the folder. That's the info I'm after. BTW when you use the properties dialogue, any desktop.ini file you may have defining the folder's icon, is wiped. – Pablo678 – 2013-12-02T23:43:50.283

I’ll give you a +1, since you did beat me by 1½ hours, but you buried the lead. It’s clear from Pablo’s question that he knows where icon bitmaps are stored; he asked where the association between a customized folder and its assigned icon was stored. You answered that question, but only after spending 25+ lines answering other questions -- and even then, you didn’t mention that desktop.ini is a hidden, system file. – Scott – 2013-12-03T16:39:06.883