Where is the Default Program associations stored in the registry?

112,700

Should be in:

HKEY_LOCAL_MACHINE\SOFTWARE\Classes and HKCU\SOFTWARE\Classes

And I don't believe that this has changed recently.

The priority is for current user, then local machine (aliased I believe to classes root).

Explorer uses a different set of registry keys that can be found at:

HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Explorer\FileExts\

Share:
112,700
Jim McKeeth
Author by

Jim McKeeth

Lead World Wide Developer Evangelist for Embarcadero Technologies Invented and patented swipe to unlock in 2000. See US Patent # 8352745 & 6766456, and others. Host of the Podcast at Delphi.org. (mostly a blog, but some podcast episodes). Preferred Languages: Delphi / Object Pascal C# / .NET JavaScript Java C++ Objective-C

Updated on September 18, 2022

Comments

  • Jim McKeeth
    Jim McKeeth almost 2 years

    If I run the assoc command-line utility for an extension, it shows the file type/description for the extension I set in the registry. But if I go to Control Panel -> Default Programs - Set Associations then I see a different description and default program.

    It used to be that setting the two keys:

    • HKCR\.ext (default) = Identifier
    • Identifier (default) = "File Description"
      • \DefaultIcon (default) = Some icon
      • \Shell\Open\Command (default) = Some editor

    But now it appears there is an override elsewhere, which is what gets displayed in the Default Programs listing.

    My question is, where i this overridden association information stored? I'm assuming it is in the registry, but I don't see it in the keys I expect it to be. I believe this was changed in the Vista time frame, but it may have been in XP too.

    Update: Since there is some confusion, do the following test. Rename a file to some new extension. Create an association in the registry keys mentioned above. Then right click on the file, Open With and select a different program (checking to make it the default). Now check the registry. It is unchanged, but now the file is associated with a different description, icon and default program.

  • Jim McKeeth
    Jim McKeeth about 12 years
    I believe that is what HKEY_CLASSES_ROOT maps too. Those store what the assoc command returns. But the override information returned by Default Programs in the Control Panel is different.
  • Jim McKeeth
    Jim McKeeth about 12 years
    I saw your edit about it being aliased to classes root. But you are missing the point that somewhere else there is overridden associations that are displayed in the Default Programs list from Control Panel.
  • soandos
    soandos about 12 years
    and it is not the settings in HKCU?
  • Jim McKeeth
    Jim McKeeth about 12 years
    Nope, see the update I added. You can test it yourself.
  • soandos
    soandos about 12 years
    Explorer uses a different registry key
  • Jim McKeeth
    Jim McKeeth about 12 years
    I was just looking in that 3rd place when you posted it. Thanks!
  • soandos
    soandos about 12 years
    You are very welcome. Sorry about the earlier confusion.