How to Export a Registry Key in Windows

  • March 6, 2019
  • Read 35,270 times
 

The Windows Registry is a centralized hierarchical database that is used by Windows to store system settings, hardware configurations, and user preferences. The Windows Registry can be explored by using a program called the Windows Registry Editor, but modifying the wrong key could cause your computer to not boot properly, so it is advised to only use it as necessary.

More detailed information about the Windows Registry can be found in our Demystifying the Windows Registry article.

When making a change to the Registry, it is recommended that you first create a export of the entries that you are about to modify. This allows you to save the information to a Registry file, or .reg file, so that if a problem occurs you can import the original settings back into the Registry.

You can see an example of a Registry file below, where each setting is saved as text in the file.

Windows Registry File (.reg)
Windows Registry File (.reg)

If you need to import the data back into the Registry, and overwrite any existing settings that it corresponds to you, you would simply double-click on the Registry file and allow the changes to be merged when Windows prompts you.

Below we have provided two methods that you can use to export data from the Windows Registry.

Method 1: Export a Registry key using the Windows Registry Editor

For most people, the easiest method to export a Registry key is to use the Windows Registry Editor. The Windows Registry Editor, otherwise known as regedit.exe, is a graphical tool that allows you to modify the Windows Registry.

To open the Registry Editor, type regedit in the Start Menu search field as shown below and then select Registry Editor.

Open the Registry Editor
Open the Registry Editor

When the Registry Editor opens, navigate to the key that you would like to export. In our example, we are going to export the HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\Session Manager\Memory Management key.

The Windows Registry Editor
The Windows Registry Editor

When at the key you wish to export, right-click on the key name and select Export as shown below.

Export key via Registry Editor
Export key via Registry Editor

Windows will now prompt you for a location and file name that you wish to save the Registry information. Please select the location, enter a filename, and press the Save button.

Save Registry File
Save Registry File

After saving the Registry file, you will see a file ending with the .reg extension at the location you saved it to.

Registry File Icon

This file can be used in the future to restore your exported settings if needed.

Method 2: Export a Registry key using the Reg command-line command

Windows includes the reg.exe program that can be used to manipulate the Windows Registry from the command line.  In order to use this tool, you will need to open an Elevated Command Prompt.  

Once an elevated command prompt is open, you can use the reg.exe command to export a Registry key using the following syntax:

reg export [key] [file_name]

For example, to export the reg export "HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\Session Manager\Memory Management" to the test.reg file, you would use the following command:

reg export "HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\Session Manager\Memory Management" test.reg

Please note, when entering the Registry key to export, we enclosed it in quotes because there was a space in the key name.

You can see an example of this command being used in the image below.

Using the Reg.exe command from an Elevated Command Prompt
Using the Reg.exe command from an Elevated Command Prompt

Once the command is executed, a file will be created, which in our case is test.reg, that contains the exported Registry key.

Users who read this also read:

  • How to Restart the Windows Explorer.exe Process Image
    How to Restart the Windows Explorer.exe Process

    When using Windows 10, you may find that the Windows desktop has frozen and you can no longer use the Start Menu, click on programs, drag files, or switch between windows. When this happens, it may be caused by the Windows Explorer, or Explorer.exe, process having issues and can typically be fixed by restarting it.

  • How to show hidden files in Windows 7 Image
    How to show hidden files in Windows 7

    Windows 7 hides certain files so that they are not able to be seen when you exploring the files on your computer. The files it hides are typically Windows 7 System files that if tampered with could cause problems with the proper operation of the computer. It is possible, though, for a user or piece of software to set make a file hidden by enabling the hidden attribute in a particular file or ...

  • How to Clear or Flush the DNS Cache in Windows Image
    How to Clear or Flush the DNS Cache in Windows

    If you are not able to connect to a particular site and its IP addresses is not resolving properly, it could be a problem with the DNS servers that you are connecting to or an incorrect DNS entry cached in the Windows DNS cache. This tutorial will explain how to flush your DNS cache to see if it fixes a problem connecting to a site.

  • How to Open a Windows Command Prompt Image
    How to Open a Windows Command Prompt

    The Windows Command Prompt is a Windows shell that allows you to execute command by typing them in and pressing enter on the keyboard. This article will provide two methods that you can use to launch the Command Prompt in Windows.

  • How to start Windows in Safe Mode Image
    How to start Windows in Safe Mode

    Windows Safe Mode is a way of booting up your Windows operating system in order to run administrative and diagnostic tasks on your installation. When you boot into Safe Mode the operating system only loads the bare minimum of software that is required for the operating system to work. This mode of operating is designed to let you troubleshoot and run diagnostics on your computer. Windows Safe Mode ...

Login

Remember Me
Sign in anonymously