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, this 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.
:max_bytes(150000):strip_icc():format(webp)/hkey-classes-root-registry-8b4daed03243417daf82e54efc181834.png)
How to Get to HKEY_CLASSES_ROOT
HKCR is a registry hive, so it sits at the top level in Registry Editor, in the root of the entire Windows Registry:
-
The easiest way to do this is to open the Run dialog box via WIN + R, and enter regedit.
-
Find HKEY_CLASSES_ROOT in the left area of Registry Editor.
You might not see it immediately if you've used the registry recently and left various hives or keys open. Press the Home key to see HKCR listed at the very top of the left pane.
-
Double-click or double-tap HKEY_CLASSES_ROOT to expand the hive, or use the small arrow to the left
Editing the registry is completely safe if you know what you're doing, but carelessness can lead to serious problems. Learn how to add, change, and delete registry keys and values for an introduction.
Registry Subkeys in HKEY_CLASSES_ROOT
The list of registry keys under this hive is very long and just as confusing. We won't explain each of the thousands of keys you might see, but we 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 HKCR hive, most of which 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 keys stores information on what Windows should do when you double-click or double-tap a file with that extension in File Explorer. It might 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, when you open a file called draft.rtf, WordPad might open it. The registry data that makes that happen is stored in the HKEY_CLASSES_ROOT\.rtf key, which defines WordPad as the program that should open the RTF file.
Due to the complexity of how HKEY_CLASSES_ROOT keys are set up, we 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 HKCR, 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 by following those links to Microsoft's website.
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.
:max_bytes(150000):strip_icc():format(webp)/hkcr-reg-backup-bd0aa2abfb9945ffaad75e851e629df4.png)
If something goes wrong, you can always restore the Windows Registry to a working state with the backup. It's as easy as opening the REG file.
More on HKEY_CLASSES_ROOT
While you can edit and completely remove any subkey inside the HKCR 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 the HKCR 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, HKEY_CLASSES_ROOT can still be browsed by any and all users.
This means, of course, that when a new registry key is made in the HKCR 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.