Export and Import Registry Keys in Windows  

    Export and Import Registry Keys in Windows

    Export and Import Registry Keys in Windows

    How to Export and Import Registry Keys in Windows
    Published by Category: General Tips
    07 May 2020
    Designer Media Ltd



    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





  1. Posts : 9,280
    Windows 10 Pro on all on various machines version 21H2 and running Window 11 on one desktop without
       #1

    Hello Shawn now just how do I backup the whole registry as just lately I tried to import a backup I made of the whole registry and broke the laptop. I had to do a complete reset of the OS and I don't want to go there again.
      My Computer


  2. Posts : 61,526
    64-bit Windows 11 Pro for Workstations
    Thread Starter
       #2

    ICIT2LOL said:
    Hello Shawn now just how do I backup the whole registry as just lately I tried to import a backup I made of the whole registry and broke the laptop. I had to do a complete reset of the OS and I don't want to go there again.
    Hello John,

    One way is to create a restore point, but this is only good for short term purposes.

    The best way is to create a system image.
      My Computers


  3. Posts : 9,280
    Windows 10 Pro on all on various machines version 21H2 and running Window 11 on one desktop without
       #3

    Ok Shawn I'll do that and as I already have an image or two I shall update it now
      My Computer


  4. Posts : 11,364
    Windows 10 Home x64 Version 21H2 Build 19044.1706
       #4

    ICIT2LOL said:
    ... how do I backup the whole registry ...
    Backup Registry Hives - TenForums

    Denis
      My Computer


  5. Posts : 9,280
    Windows 10 Pro on all on various machines version 21H2 and running Window 11 on one desktop without
       #5

    Thanks Denis I will try and follow that although it still looks rather convoluted
      My Computer


  6. Posts : 11,364
    Windows 10 Home x64 Version 21H2 Build 19044.1706
       #6

    ICIT2LOL said:
    Thanks Denis I will try and follow that although it still looks rather convoluted
    I wrote my own batch script. Like Freebooters, it can just be run without any messing about, without any convoluted actions.
    I included
    - Reg Save for each main hive [like Freebooter]
    - Reg Export for each main hive
    - Backup of user profiles for users other than the main user [who always does the backups]. Each C:\Users\EachUserName\ntuser.dat is their own Registry HKCU hive; the current user's ntuser.dat cannot be directly saved or exported because it is already loaded as HKCU.

    My main backups are my system images and I do not recall a single occasion when I've used my Registry backups for anything except looking things up.
    - You can open backed up Registry hives in Notepad but it's all a bit overwhelming.
    - You can temporarily load backed up Registry hives as additional hives in RegEdit and they are presented in the same manner as any other hives so are easy to browse through and work with.
    - See steps 1 to 6 of- These steps are illustrated in Modify Registry from InstallUSB [SIW2 #19] - TenForums but just use the illustrations to help you understand my steps 1-6 because you are not trying to do what SIW2 is helping the user with in that thread.


    We've had many discussions in TenForums about Registry backups. See, for example, My Registry backup plan - TenForums

    Denis
      My Computer


 

Tutorial Categories

Export and Import Registry Keys in Windows Tutorial Index Network & Sharing Instalation and Upgrade Browsers and Email General Tips Gaming Customization Apps and Features Virtualization BSOD System Security User Accounts Hardware and Drivers Updates and Activation Backup and Restore Performance and Maintenance Mixed Reality Phone


  Related Discussions
Our Sites
Site Links
About Us
Windows 10 Forums is an independent web site and has not been authorized, sponsored, or otherwise approved by Microsoft Corporation. "Windows 10" and related materials are trademarks of Microsoft Corp.

© Designer Media Ltd
All times are GMT -5. The time now is 15:54.
Find Us




Windows 10 Forums