How can I extract an icon from a file-type and apply it to a shortcut?
I have a file of type *.xyz
that has a nice icon. I would like to set that icon as the icon for a shortcut on my desktop. However, the "change icon" option in the properties dialog can only extract icons from .dll
s, .exe
s, and .ico
s. I have had no luck finding the .dll
/.exe
/.ico
from which this file's icon originates.
How can I find the resource containing the icon used for a particular file extension?
if you are familiar with the registry, that info is stored under HKEY_CLASSES_ROOT
- open regedit (don't mess around and change anything)
- there will be a list of folders in the treeview on the left, click on the one that is called "HKEY_CLASSES_ROOT". look through that long list for the extension .xyz
- when you click on it, the filetype will be listed.
- now search down the list under HKEY_CLASSES_ROOT until you find that type
- under that type will be a folder called DefaultIcon where you will find the icon used
Use IrfanView, www.irfanview.com, one of the more useful free programs on the web.
Install it, run it, and drag the .exe onto IrfanView's window.
The icon will show up in the IrfanView screen. If there are multiple icons, you can page through them by clicking the DOWN arrow on the menu bar at the top of the IrfanView screen.
You can save an icon to a separate file using File -> Save As. You can export all of them using OPTIONS -> EXTRACT_ALL_FRAMES. Try different file types for the best resolutions. .ICO file type is a good place to start.
I just extracted about 50 icons from a Windows 3.1 executable in about 1 second.