How To Compress Registry in Windows 10

After installing and removing a lot of apps and updates, you may notice that your Registry has become quite bloated. Your Registry files may have become quite large. Large Registry files can cause slowdowns and performance issues in Windows 10. Here is how you can compress them.


Registry consists of several files, which form the registry database. You can see which files represent your registry database if you open the following Registry key:

HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\hivelist

hivesHere you can see the list of files on your disk drive where the Registry files are stored. The data inside them, has a hierarchical structure. Registry Editor shows it as a tree view: there are "root" (parent) keys, and several sub-keys (child objects). The root keys shown in Regedit for the most part, represent the specific file, or in other words, the registry files correspond to keys' hierarchy. However, there are also some virtual root keys shown in Regedit which exist for backward compatibility. For example, HKEY_CURRENT_CONFIG is a virtual view, and HKEY_CLASSES_ROOT is also a virtual view of the current user's key + system keys.

Note that some parts of the Registry database are never shown in Registry editor. For example, you will never see SAM (Security Accounts Manager) inside Regedit.

You can compress the Registry in Windows 10 without using third party software. However, you need to have a bootable media with Windows 10. It can be a USB stick or a UEFI bootable flash drive.

  1. Insert your bootable media and boot your PC from USB. (You may need to press some keys or change BIOS options to boot from USB.)
  2. When the "Windows Setup" screen appears, press Shift + F10 keys together.
    Windows 10 setup screen
    This will open the command prompt.
    Windows 10 setup screen cmd
  3. Type regedit and press Enter. Do not close the command prompt window.Run Regedit In WinPE
  4. In Regedit, load the large Registry file (hive) from the target file system (e.g. your C: drive where the Windows folder is).
    Select HKEY_LOCAL_MACHINE on the left and select File - Load hive... in the menu.Select HKLM On The LeftFile Load Hive
    When prompted for a name, use any name to serve as the mount point under the HKLM branch. e.g. if you enter Bloated, the selected Registry file will be mounted under HKLM\Bloated.Load A HiveHive Is Loaded
    Please refer to the following article to learn more about hive loading: How to access the Registry of another user or another OS
  5. Once the huge file has been loaded, export it as a "Registry Hive" file with a unique name, e.g. C:\windows\system32\config\compressedhive, where the folder C:\windows is your Windows directory on your computer's hard drive. Select the loaded hive on the left and select File - Export as.File ExportWindows 10 Compress Registry
  6. Tip: You can use the dir command at the command prompt to verify the old and new sizes of the registry files.Windows 10 Registry Compressed
  7. Now, unload the file from Regedit by selecting the 'Bloated' key and selecting Unload hive from File menu of Registry Editor. If you get an "Access denied" error here, close the Registry editor. Then reopen the Registry editor and try again.Windows 10 Unload Hive
  8. Rename the original Registry file, for example, you can use the following command:
    ren d:\windows\system32\config\software software.my

    Windows 10 Renamed Old Hive

  9. Place the new file you exported instead of the old one.
    ren d:\windows\system32\config\compressedhive software

    Windows 10 Renamed New Hive

  10. Close the command prompt and the setup program. This will restart your computer.

That's it. This way, you can compress all your Registry files. This trick should work in Windows 8 and Windows 7 too.

4 thoughts on “How To Compress Registry in Windows 10

  1. Alicia

    can i create the restore point first?

    Reply
    1. Sergey Tkachenko Post author

      Sure.

      Reply
  2. Marko

    I use CCleaner, and WinASO’s Registry Optimizer, of which the WinASO software will clean and defrag the registry. Is that not accomplishing the same thing? Thanks.

    Reply
    1. newton181

      Yes, but this is a Do It Yourself blog, quoting this post :”You can compress the Registry in Windows 10 without using third party software.”

      Reply

Leave a Reply

Your email address will not be published. Required fields are marked *