I have an XML file saved with the extension .xml. XML files are registered to open with Notepad++, and double-clicking the file opens it in Notepad++ as expected. However, the icon shows it to be an Excel file, and rightly so - the file is formated as SpreadsheetML.

I'm used to files being associated with a particular program to open them, but how does Windows Explorer know to show the Excel icon for that file?


I'm pretty sure what's happening is that when you install Office onto a Windows 7 computer it changes the XML icon path from a static path (see: HKEY_CLASSES_ROOT\xmlfile\DefaultIcon in the registry), to a "%1" variable.

In combination with the fact that the xmlfile entry also has a ShellEx\IconHandler key means that the icon is dynamically controlled by a DLL (or some other handler). If you look up the GUID in the IconHandler default value's data, you can figure out what program is being used to handle that icon.

Mine happens to be {AB968F1E-E20B-403A-9EB8-72EB0EB6797E}, so I searched the registry until I found HKEY_LOCAL_MACHINE\SOFTWARE\Classes\Wow6432Node\CLSID\{AB968F1E-E20B-403A-9EB8-72EB0EB6797E}\InprocServer32

Which lists "C:\Program Files (x86)\Common Files\Microsoft Shared\OFFICE12\MSOXEV.DLL" as the program handling it. So when an XML is queried, the MSOXEV.DLL is checked, which interrogates the file deeply, and determines which icon to display.

There's also an excellent explanation in an answer to a similar question over at StackOverflow if you want to go check that out as well.


The icons used in Windows are saved in a cache, which is used to optimize the display of icons.

You can:

  1. reboot your pc

  2. Recreate the icon cache by changing icon size (change it by appearance menu)

  3. Recreate the icon cache file by deleting it;

    • In Windows XP delete the file:

      C:\Documents and Settings\Your User Name\Local Settings\Application Data\Iconcache.db
    • In Vista/7 delete the file:


After deletion terminate from the Task Manager every explorer.exe process and start a new one (this will recreate the icon cache).

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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