Take the 2-minute tour ×
Super User is a question and answer site for computer enthusiasts and power users. It's 100% free, no registration required.

Say I have a file and there is set an icon to it. How to get the icon which is figured on the file? File is an arbitrary - some extension about which I have no idea. Just how to get its icon.

EDIT: BTW the icon which is figured on the file is assigned when I told to SO open the file with an exe file I have created. And in that exe file there is no the icon that is on the file. Just, I guess, OS (Vista) have crated the icon of the file by takeing the icon of exe file and bu "putting" that on a white paper. SO I want to get this icon.

share|improve this question

4 Answers 4

up vote 5 down vote accepted

File association icons are assigned by Windows, most of which are found in %Windir%\system32\shell32.dll. You can find out which file provides a particular icon by going to Tools - Folder Options - File Types and then clicking the 'Advanced' button for your desired file type. Finally, click 'Change icon' in the window that appears and it will show you the path to the file's icon.

You can use Resource Hacker to export the icon from the file.

share|improve this answer
    
What about for Vista? –  Narek Jul 26 '10 at 20:02
    
Vista OS Icon Location: C:\Windows\System32\imageres.dll C:\Windows\System32\shell32.dll –  djshortbus Jul 26 '10 at 20:31
    
"Finally, click 'Change icon' in the window that appears and it will show you the path to the file's icon." I meant where to find to path of the current icon in Vista? –  Narek Jul 27 '10 at 6:45
1  
Vista does not offer extensive file type configuration like XP, unfortunately. To retrieve the icon location of a specific filetype you need to access the registry. 1. Run regedit. 2. Navigate to ..\HKEY_CLASSES_ROOT\ 3. Find the key of your filetype. In my example, it's .ace. 4. Read the (Default) value. In my case it reads "WinRAR". 5. Navigate to the key of this value (..\HKEY_CLASSES_ROOT\WinRAR) 6. Open the DefaultIcon key. 7. The (Default) value of this key contains the path to the icon. (C:\Program Files\WinRAR\WinRAR.exe) Screenshot: tinyurl.com/39qakoe –  Rob Jul 30 '10 at 20:45
    
as an aside, if you then wanted to change the icon, you could use something like botproductions.com/iconview/iconview.html to find an icon you would like to use. –  Robert S Ciaccio Aug 5 '10 at 0:30

Batch Icon Extractor

Download BatchIconExtractor.exe and place it on your desktop. Drag and drop a file or a folder on the application icon. All icons from the file or from all files under the given folder are saved to a new folder called "icons". This folder is created in the same folder, where the application resides (Desktop by default).

share|improve this answer
    
Program says "The argument specified does not appear to be a file with icons or a folder." BTW the program is right. This icon was "granted" to it extension by Win. Vista. So the icon should be somwhere else not in the file. –  Narek Jul 26 '10 at 20:02

The only way I know, apart from digging in the registry, is with .Net code. There's a function called ExtractAssociatedIcon() which gives you the associated icon with whichever file you pass it. Perhaps not the answer you're looking for, but there is no accessible interface built into Windows for this specific task ;)

Update: For making such an app, see http://pastie.org/1075055 (copy the code using the RAW button so avoid line numbers)

share|improve this answer

IconPackager is a tool for Windows Vista that lets you edit the icons. (Windows XP had this ability built-in.)

ResEdit is a good resource editor which will allow you to open and save the icons contained in an .exe file.

share|improve this answer

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

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