Where are the folder icons generated with the folder properties kept in the Registry?
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?
Solution 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.
Solution 2:
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
-
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 -
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