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:
- Registry | Microsoft Docs
- Registry Editor | Microsoft Docs)
- Windows registry information for advanced users | Windows Support
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
- Option One: Export Registry Key in Registry Editor
- Option Two: Export Registry Key in Command Prompt
- Option Three: Import Registry Key using REG file
- Option Four: Import Registry Key in Registry Editor
- Option Five: Import Registry Key in Command Prompt
EXAMPLE: 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.
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.
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)
6 When finished exporting registry keys, you can close Registry Editor if you like.
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"
3 You can now close the command prompt if you like.
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.
3 If prompted by UAC, click/tap on Yes to approve elevation. (see screenshot below)
4 Click/tap on Yes to confirm. (see screenshot below)
5 Click/tap on OK. (see screenshot below)
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)
4 Navigate to and select the .reg file you want to import, and click/tap on Open. (see screenshot below)
5 Click/tap on OK. (see screenshot below)
6 When finished importing .reg files, you can close Registry Editor if you like.
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"
3 You can now close the command prompt if you like.
That's it,
Shawn
Related Tutorials
- How to Change the Registry Editor Font in Windows 10
- How to Switch Between HKCU and HKLM Keys in Registry Editor in Windows 10
- How to Turn On or Off Registry Editor Address Bar in Windows 10
- How to Add Registry Editor to Control Panel in Windows
- How to Reset Registry Editor Default Position, Size, and Layout in Windows 10