Backup and Restore Export and Import Keys in Registry Editor in Windows 11


Registry_Editor_banner.png

This tutorial will show you how to export and import registry keys in Registry Editor using a REG file in Windows 10 and Windows 11.

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.

You can export registry keys from Registry Editor to back up the selected key and its subkeys values and data to a REG file.

You can import a REG file to restore its keys, values, and data settings back to Registry Editor.

The HKEY_CURRENT_USER (HKCU) branch only affects the current user, and does not require being an administrator to export or import keys under it.

You must be signed in as an administrator to import keys from the following registry branches since they affect all users. You do not need to be an administrator to export keys under these branches.
  • HKEY_CLASSES_ROOT (HKCR)
  • HKEY_LOCAL_MACHINE (HKLM)
  • HKEY_USERS (HKU)
  • HKEY_CURRENT_CONFIG
References:


Contents





Option One

Export Registry Key in Registry Editor


1 Open Registry Editor (regedit.exe)

2 In the left pane of Registry Editor, select the registry key or subkey you want to back up. (see screenshot below)

export_Registry_Editor-1.png

3 Perform an action below to export the selected key or subkey. (see screenshots below)
  • Click/tap on File on the menu bar, and click/tap on Export.
  • Right click on the selected key or subkey, and click/tap on Export.
  • Press the Alt + F keys, and press the E key.
export_Registry_Editor-3.png
export_Registry_Editor-2.png

4 Perform the steps below to export the key or subkey to a REG file: (see screenshot below)
  1. Navigate to and select the location (ex: Desktop) you want to save the REG file to.
  2. Type a File name you want for the REG file.
  3. Click/tap on Save.
export_Registry_Editor-4.png

5 When finished, you can close Registry Editor if you like.




Option Two

Export Registry Key using Command


1 Open Windows Terminal, and select either Windows PowerShell or Command Prompt.

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

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

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

Substitute full path of key in the command above with the actual full path of the key or subkey you want to export from Registry Editor.

Substitute full path to save .reg file in the command above with the actual full path of the location you want to save the .reg file including its file name and .reg extension.

For example: reg export "HKEY_CURRENT_USER\Control Panel\Cursors" "C:\Users\Brink\Desktop\My_Cursors_settings.reg"


3 You can now close Windows Terminal if you like.

reg-export_command.png





Option Three

Import Registry Key using REG file


1 Perform an action below to import a REG file:
  • Double click/tap on the REG file.
  • Right click on the REG file, and click/tap on Merge.
2 If prompted by UAC, click/tap on Yes to approve. (see screenshot below)

import_REG_file-1.png

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

import_REG_file-2.png

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

import_REG_file-3.png




Option Four

Import Registry Key in Registry Editor


1 Open Registry Editor (regedit.exe)

2 Perform an action below to import a REG file: (see screenshot below)
  • Click/tap on File on the menu bar, and click/tap on Import.
  • Press the Alt + F keys, and press the I key.
import_Registry_Editor-1.png

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

import_Registry_Editor-2.png

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

import_Registry_Editor-3png.png

5 When finished, you can close Registry Editor if you like.




Option Five

Import Registry Key using Command


1 Open Windows Terminal or Windows Terminal (Admin) depending on REG access rights, and select either Windows PowerShell or Command Prompt.

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

reg import "full path of .reg file"

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

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


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

reg-import_command.png



That's it,
Shawn Brink
 
Last edited:
if you want to export multiple keys and merge them in 1 .reg instantly, paste the following into notepad and save as a batch file (.bat). it will pull all keys you specify, merge them into 1 and save the .reg in the same directory you run the .bat from:

Code:
<# :
  @echo off
    powershell /nologo /noprofile /command ^
        "&{[ScriptBlock]::Create((cat """%~f0""") -join [Char[]]10).Invoke(@(&{$args}%*))}"
  exit /b
#>

New-Item -Path "c:\temp" -Name "dump" -ItemType "directory" -ErrorAction SilentlyContinue

$keys = Get-ChildItem -path HKCU:\software\StartIsBack, HKLM:\software\StartIsBack

$tempFolder = 'C:\temp\dump'
$outputFile = 'C:\temp\Output.reg'

$i = 1;
$keys | ForEach-Object {
  $i++
  & reg export $_ "$tempFolder\$i.reg"
}

'Windows Registry Editor Version 5.00' | Set-Content $outputFile
Get-Content "$tempFolder\*.reg" | Where-Object {
  $_ -ne 'Windows Registry Editor Version 5.00'
} | Add-Content $outputFile

Remove-Item C:\temp\dump -Recurse


REPLACE "HKCU:\software\StartIsBack, HKLM:\software\StartIsBack" with desired registry keys to backup
REPLACE "Output" with whatever you want to name the registry key output (file saved)
YOU CAN ADD as many as you want.
Output.reg is saved to C:\temp

*WILL remove extra headers (Windows Registry Editor Version 5.00)
 
Last edited:

My Computer

System One

  • OS
    Windows 11 Pro
1. reg export doesn't allow a trailing "\" in the registry path.
Code:
C:\Users\GARLIN\Downloads>reg export "HKEY_CURRENT_USER\Software\" .\dump_1.reg
ERROR: Invalid syntax.
Type "REG EXPORT /?" for usage.

C:\Users\GARLIN\Downloads>reg export "HKEY_CURRENT_USER\Software" .\dump_1.reg
The operation completed successfully.

2. Windows requires this header block on all proper .reg files:
Code:
Windows Registry Editor Version 5.00

The header is only allowed to appear once per file. You cannot import an appended file without removing the duplicate headers.

3. When appending from different files, you can end up with conflicting reg values and only the last one for the same value wins. Processing is done in sequential order.
Code:
Windows Registry Editor Version 5.00

[HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\FileSystem]
"NtfsDisable8dot3NameCreation"=dword:00000001

[HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\FileSystem]
"NtfsDisable8dot3NameCreation"=dword:00000000

Since you're the one doing the appends, it's your responsibility to keep this fact in mind.
 

My Computer

System One

  • OS
    Windows 7

Latest Support Threads

Back
Top Bottom