How to Export and Import Registry Keys in Windows


System configuration information is stored centrally in a hierarchical database called the registry. The registry is a system-defined database in which applications and system components store and retrieve configuration data. The data stored in the registry varies according to the version of Microsoft Windows. Applications use the registry API to retrieve, modify, or delete registry data.

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
Export and Import Registry Keys in Windows-registry_editor.png






OPTION ONE

Export Registry Key in Registry Editor


1 Press the Win + R keys to open Run, type regedit into Run, 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.

Export and Import Registry Keys in Windows-export_registry_key_in_registry_editor-1.png

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.

Export and Import Registry Keys in Windows-export_registry_key_in_registry_editor-2.jpg Export and Import Registry Keys in Windows-export_registry_key_in_registry_editor-3.jpg

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)

Export and Import Registry Keys in Windows-export_registry_key_in_registry_editor-4.png

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






OPTION TWO

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"

Export and Import Registry Keys in Windows-export_registry_key_in_command_prompt.jpg

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






OPTION THREE

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.

Export and Import Registry Keys in Windows-import_registry_key.jpg

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

Export and Import Registry Keys in Windows-approve_merge_reg_file-1.png

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

Export and Import Registry Keys in Windows-approve_merge_reg_file-2.png

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

Export and Import Registry Keys in Windows-approve_merge_reg_file-3.png






OPTION FOUR

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 into Run, 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)

Export and Import Registry Keys in Windows-import_registry_key_in_registry_editor-1.jpg

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

Export and Import Registry Keys in Windows-import_registry_key_in_registry_editor-2.png

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

Export and Import Registry Keys in Windows-approve_merge_reg_file-3.png

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






OPTION FIVE

Import 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"

Export and Import Registry Keys in Windows-import_registry_key_in_command_prompt.png

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


That's it,
Shawn