Working with Windows Registry – Part 2 (How to Backup the Registry)

  In the previous article, we discussed the fundamentals of the Windows Registry and listed some Windows API functions that are used to create, edit and delete registry keys. Here, we shall tell you how to create a backup of the registry, which is a crucial thing to know while learning about working with Windows Registry.

Working with Windows Registry – How to Backup the Registry

As we have mentioned previously, the registry is one of the most critical parts of Windows. Even a small mistake may translate into serious trouble for you. Therefore, you must be very cautious while making any changes to the registry. We would suggest that you create a backup of your registry before you make any changes to it. The process of backing up the registry is very simple.

 

  • Open the Registry Editor – by typing regedit.exe  in the search box of the Start Menu.
  • Right-click the key you want to backup. For example, if you want to backup HKEY_LOCAL_MACHINE, right-click on it.
  • Click on ‘Export’ in the menu that pops up.
  • A new dialog box opens named ‘Export Registry File’. In this dialog box, enter the name of the file you want to create for registry backup. For example, “LocalMachine”.
  •  The file “LocalMachine.reg” (or whatever name you specify) will be created. This file contains the backup of the key named “HKEY_LOCAL_MACHINE”. Similarly, you may backup “HKEY_CURRENT_USER”, “HKEY_CURRENT_CONFIG” etc.
  •  You can also choose individual keys to backup in a similar way. Or, if you want, you may create the backup of the whole registry in a single file. To do so, click on the “Computer” in the Registry Editor window and click ‘Export’ and enter the filename.
Note : Although you may backup the entire registry in one go, it is recommended that you backup only those keys which you’re going to modify. For example, if you want to modify the values of HKEY_LOCAL_MACHINE\SOFTWARE\Windows Code Bits, then you must backup the Windows Code Bits key only. Backing up the entire registry may be undesirable in certain conditions.

The Registry Backup files (i.e. the files with .reg extension which are created when you backup a key) vary in size. It may be a few bytes/kilobytes or even hundreds of megabytes. When I backed up the HKEY_LOCAL_MACHINE registry key on my Windows 7 PC, it took up about 265 MB of space !!!

The following video shows how to backup a registry key. We recommend that you watch it carefully :


The next article will show you how to create registry keys using Windows API functions.

(Visited 203 times, 1 visits today)

Leave a Reply

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