How to Export and Import Registry Keys in Windows


System configuration information is stored centrally in a hierarchical database called the registry. You can use Registry Editor to add and edit registry keys and values, restore the registry from a backup or to default values, and to import or export keys for reference or backup.

For more in-depth details about Registry Editor (regedit), see:

This tutorial will show you how to import and export registry keys using a .reg file for Registry Editor in Windows 7, Windows 8, and Windows 10.

You must be signed in as an administrator to import and export keys from the following registry hives (group of keys) below. The HKEY_CURRENT_USER hive only affects the current user, and does not require being an administrator.
  • HKEY_CLASSES_ROOT
  • HKEY_LOCAL_MACHINE
  • HKEY_USERS
  • HKEY_CURRENT_CONFIG

 CONTENTS:



EXAMPLE: Registry Editor
Name:  Registry_Editor.png
Views: 3061
Size:  7.3 KB






Export and Import Registry Keys in Windows OPTION ONE Export and Import Registry Keys in Windows
Export Registry Key in Registry Editor

1. Press the Win+R keys to open Run, type regedit, and click/tap on OK to open Registry Editor.

2. If prompted by UAC, click/tap on Yes to approve elevation.

3. In the left pane of Registry Editor, navigate to and select the key you want to export. (see screenshot below)

All subkeys of this selected key will also be included in the export.

Name:  Export_registry_key_in_Registry_Editor-1.png
Views: 3203
Size:  14.4 KB

4. Perform one of the following actions below to export the selected key to a .reg file. (see screenshots below)

A) Right click or press and hold on the key, and click/tap on Export.

OR

B) Click/tap on File (menu bar), and click/tap on Export.

Name:  Export_registry_key_in_Registry_Editor-2.jpg
Views: 3158
Size:  51.6 KB Name:  Export_registry_key_in_Registry_Editor-3.jpg
Views: 3082
Size:  34.2 KB

5. Navigate to the location for where you want to save the export, type a name you want for the .reg file, and click/tap on Save. (see screenshot below)

Name:  Export_registry_key_in_Registry_Editor-4.png
Views: 3069
Size:  18.0 KB

6. When finished exporting registry keys, you can close Registry Editor if you like.






Export and Import Registry Keys in Windows OPTION TWO Export and Import Registry Keys in Windows
Export Registry Key in Command Prompt

To see more usage details for the reg export command, see: reg export | Microsoft Docs

1. Open a command prompt or elevated command prompt depending on the required rights of the key you want to export.

2. Type the command below into the command prompt, and press Enter. (see screenshot below)

Reg export "full path of key" "full path to save .reg file name"

All subkeys of this key will also be included in the export.

Substitute full path of key in the command below with the actual full path of the key (ex:"HKEY_CURRENT_USER\Printers") you want to export from Registry Editor.

Substitute full path to save .reg file name in the command below with the actual full path of the location you want to save the .reg file including the name you want for the .reg file with extension. For example: "%UserProfile%\Desktop\Printers.reg"

For example: Reg export "HKEY_CURRENT_USER\Printers" "%UserProfile%\Desktop\Printers.reg"


Name:  Export_registry_key_in_command_prompt.jpg
Views: 3057
Size:  25.9 KB

3. You can now close the command prompt if you like.






Export and Import Registry Keys in Windows OPTION THREE Export and Import Registry Keys in Windows
Import Registry Key using REG file

When you import (merge) a .reg file, it will overwrite and replace the current key(s) and data value(s) in your registry with the contents of the .reg file.

It is highly recommend that you create a restore point before importing a .reg file to be able to quickly do a system restore if needed (ex: caused issue) afterwards.

1. Open File Explorer (Win+E), and navigate to the location of the .reg file you want to import.

2. Perform one of the following actions below to import (merge) the .reg file. (see screenshot below)

A) Double click/tap on the .reg file

OR

B) Right click or press and hold on the .reg file, and click/tap on Merge.

Name:  Import_registry_key.jpg
Views: 3075
Size:  38.1 KB

3. If prompted by UAC, click/tap on Yes to approve elevation. (see screenshot below)

Name:  Approve_merge_reg_file-1.png
Views: 3058
Size:  9.2 KB

4. Click/tap on Yes to confirm. (see screenshot below)

Name:  Approve_merge_reg_file-2.png
Views: 3049
Size:  7.5 KB

5. Click/tap on OK. (see screenshot below)

Name:  Approve_merge_reg_file-3.png
Views: 3057
Size:  6.4 KB






Export and Import Registry Keys in Windows OPTION FOUR Export and Import Registry Keys in Windows
Import Registry Key in Registry Editor

When you import (merge) a .reg file, it will overwrite and replace the current key(s) and data value(s) in your registry with the contents of the .reg file.

It is highly recommend that you create a restore point before importing a .reg file to be able to quickly do a system restore if needed (ex: caused issue) afterwards.

1. Press the Win+R keys to open Run, type regedit, and click/tap on OK to open Registry Editor.

2. If prompted by UAC, click/tap on Yes to approve elevation.

3. Click/tap on File (menu bar), and click/tap on Import. (see screenshot below)

Name:  Import_registry_key_in_Registry_Editor-1.jpg
Views: 3075
Size:  22.3 KB

4. Navigate to and select the .reg file you want to import, and click/tap on Open. (see screenshot below)

Name:  Import_registry_key_in_Registry_Editor-2.png
Views: 3073
Size:  16.1 KB

5. Click/tap on OK. (see screenshot below)

Name:  Approve_merge_reg_file-3.png
Views: 3057
Size:  6.4 KB

6. When finished importing .reg files, you can close Registry Editor if you like.






Export and Import Registry Keys in Windows OPTION FIVE Export and Import Registry Keys in Windows
Export Registry Key in Command Prompt

To see more usage details for the reg import command, see: reg import | Microsoft Docs

When you import (merge) a .reg file, it will overwrite and replace the current key(s) and data value(s) in your registry with the contents of the .reg file.

It is highly recommend that you create a restore point before importing a .reg file to be able to quickly do a system restore if needed (ex: caused issue) afterwards.

1. Open a command prompt or elevated command prompt depending on the required rights of the key(s) in the .reg file you want to import.

2. Type the command below into the command prompt, and press Enter. (see screenshot below)

Reg import "full path of .reg file name"

Substitute full path of .reg file name in the command below with the actual full path of the .reg file including its name and extension you want to import (merge) into your registry.

For example: Reg import "C:\Users\Brink\Desktop\Printers.reg"


Name:  Import_registry_key_in_command_prompt.png
Views: 3050
Size:  5.3 KB

3. You can now close the command prompt if you like.


That's it,
Shawn