What is HKEY_CLASSES_ROOT?

Details on the HKEY_CLASSES_ROOT Registry Hive

Screenshot of the HKEY_CLASSES_ROOT registry hive in Windows 10
HKEY_CLASSES_ROOT Registry Hive (Windows 10).

HKEY_CLASSES_ROOT, often shortened as HKCR, is a registry hive in the Windows Registry and contains file extension association information, as well as a programmatic identifier (ProgID), Class ID (CLSID), and Interface ID (IID) data.

In the simplest terms possible, the HKEY_CLASSES_ROOT registry hive contains the necessary information for Windows to know what to do when you ask it to do something, like to view the contents of a drive, or open a certain type of file, etc.

How to Get to HKEY_CLASSES_ROOT

HKEY_CLASSES_ROOT is a registry hive and so sits at the top level in Registry Editor:

  1. Open Registry Editor
  2. Find HKEY_CLASSES_ROOT in the left area of Registry Editor
  3. Double-click or double-tap on the word HKEY_CLASSES_ROOT to expand the hive, or use the small arrow to the left

If Registry Editor has been used on your computer before, you may need to collapse any open registry keys before you'll be able to see the HKEY_CLASSES_ROOT hive. This can be done in the same way they're opened - by double-clicking/tapping, them or by selecting the arrow.

Registry Subkeys in HKEY_CLASSES_ROOT

The list of registry keys under the HKEY_CLASSES_ROOT hive is very long and just as confusing. I can't explain each of the thousands of keys you might see, but I can break it down into some manageable pieces, which will hopefully clarify this part of the registry a bit.

Here are some of the many file extension association keys you'll find under the HKEY_CLASSES_ROOT hive, most of which will begin with a period:

  • HKEY_CLASSES_ROOT\.avi
  • HKEY_CLASSES_ROOT\.bmp
  • HKEY_CLASSES_ROOT\.exe
  • HKEY_CLASSES_ROOT\.html
  • HKEY_CLASSES_ROOT\.pdf
  • HKEY_CLASSES_ROOT\AudioCD
  • HKEY_CLASSES_ROOT\dllfile
  • ...

Each of these registry keys stores information as to what Windows should do when you double-click or double-tap on a file with that extension.

It may include the list of programs found in the "Open with..." section when right-clicking/tapping a file, and the path to each application listed.

For example, on my computer, when I double-click or double-tap on a file by the name of draft.rtf, WordPad opens the file. The registry data that makes that happen is stored in the HKEY_CLASSES_ROOT\.rtf key, which, on my computer, defines WordPad as the program that should open the RTF file.

Warning: Due to the complexity of how HKEY_CLASSES_ROOT keys are setup, I absolutely do not recommend that you change default file associations from within the registry. Instead, see How To Change File Associations in Windows for instructions on doing this from within your normal Windows interface.

HKCR & CLSID, ProgID, & IID

The remainder of the keys in HKEY_CLASSES_ROOT are ProgID, CLSID, and IID keys. Here are some examples of each:

ProgID keys are located in the root of HKEY_CLASSES_ROOT, alongside the file extension associations discussed above:

  • HKEY_CLASSES_ROOT\FaxServer.FaxServer
  • HKEY_CLASSES_ROOT\JPEGFilter.CoJPEGFilter
  • HKEY_CLASSES_ROOT\WindowsMail.Envelope
  • ...

All CLSID keys are located under the CLSID subkey:

  • HKEY_CLASSES_ROOT\CLSID\{00000106-0000-0010-8000-00AA006D2EA4}
  • HKEY_CLASSES_ROOT\CLSID\{06C792F8-6212-4F39-BF70-E8C0AC965C23}
  • HKEY_CLASSES_ROOT\CLSID\{FA10746C-9B63-4b6c-BC49-FC300EA5F256}
  • ...

All IID keys are located under the Interface subkey:

  • HKEY_CLASSES_ROOT\Interface\{0000000d-0000-0000-C000-000000000046}
  • HKEY_CLASSES_ROOT\Interface\{00000089-0000-0010-8000-00AA006D2EA4}
  • HKEY_CLASSES_ROOT\Interface\{00000129-0000-0000-C000-000000000046}
  • ...

What ProgID, CLSID, and IID keys are for are related to some very technical aspects of computer programming and are beyond the scope of this discussion. However, you can read more about all three here, here, and here, respectively.

Backing Up the HKEY_CLASSES_ROOT Hive

Without exception, you should always make a backup of any registry entries you plan on editing or removing. See How To Back Up the Windows Registry if you need help backing up HKEY_CLASSES_ROOT, or any other location in the registry, to a REG file.

If something goes wrong, you can always restore the Windows Registry to a working state with the backup. All you have to do is double-click or double-tap on that REG file and confirm that you want to make those changes.

More on HKEY_CLASSES_ROOT

While you can edit and completely remove any subkey inside the HKEY_CLASSES_ROOT hive, the root folder itself, like all hives in the registry, cannot be renamed or removed.

HKEY_CLASSES_ROOT is a global hive, which means it can contain information that applies to all the users on the computer and is viewable by every user. This is in contrast to some hives that have information that applies only to the currently signed-in user.

However, because HKEY_CLASSES_ROOT hive is actually combined data found in both the HKEY_LOCAL_MACHINE hive (HKEY_LOCAL_MACHINE\Software\Classes) and the HKEY_CURRENT_USER hive (HKEY_CURRENT_USER\Software\Classes), it also contains user-specific information as well. Even though that's the case, the HKEY_CLASSES_ROOT is still able to be browsed by any and all users.

This means, of course, that when a new registry key is made in the HKEY_CLASSES_ROOT hive, the same one will appear in HKEY_LOCAL_MACHINE\Software\Classes, and when one is deleted from either, the same key is removed from the other location.

If a registry key resides in both locations, but conflicts in some way, the data found in the signed-in user's hive, HKEY_CURRENT_USER\Software\Classes, takes priority and is used in HKEY_CLASSES_ROOT.