automatic or scripted backup of just selected registry keys

Page 1 of 2 12 LastLast

  1. Posts : 1,797
    Windows 10 Pro
       #1

    automatic or scripted backup of just selected registry keys


    I want to back up just selected keys, for example the key(s) for user IDs and passwords, drive shares, file ownership, and my Microsoft Games scores. Also System Properties. I'm sure that I will think of more keys to back up about five minutes after I hit the SUBMIT button.

    To be clear I am not a registry expert so I also need a way to know which keys to back up.
      My Computers


  2. Posts : 17,038
    Windows 10 Home x64 Version 22H2 Build 19045.4170
       #2

    x509 said:
    I also need a way to know which keys to back up.
    What is your selection criteria?
    Nobody else can decide what you want to do.
    We could be here til the cows come home discussing what might be worth backing up.
    - I know of nothing in the Registry that could 'backup' a user account. How to Migrate a Windows User to Different Windows 10 PC - HTG
    - Shared folders are identified in HKLM\SYSTEM\CurrentControlSet\Services\LanmanServer\Shares I only regard that Key as a source of information. I have no reason to believe that restoring the contents of that Key would result in the identified folders becoming shared.
    - I don't know of any Registry entries concerning file ownership.
    - I know nothing about Games.
    - What do you mean 'System properties'?


    Backing up specified Registry Keys is straightforward. You can use reg commands in a batch file to copy each desired Key. For example,
    Code:
    reg export HKCU\Whatever "H:\Backups\Registry\HKCU-Whatever.reg" /y >"H:\Backups\Registry\Backup.Log"
    Reg - SS64
    reg - MSLearn


    And there are tools for Registry backing up. See, for example,
    - dalchina's suggestion in Backup Registry Hives - TenForums
    - the ideas in Registry Backups - TenForums
    - the ideas in My Registry backup plan - TenForums


    Some Registry Key backups can be very large and NotePad or even Word can struggle with reading them. I read mine with NotePad++ instead.


    Denis
    Last edited by Try3; 28 Apr 2023 at 03:25.
      My Computer


  3. Posts : 1,797
    Windows 10 Pro
    Thread Starter
       #3

    Try3 said:
    What is your selection criteria?
    Nobody else can decide what you want to do.
    We could be here til the cows come home discussing what might be worth backing up.
    - I know of nothing in the Registry that could 'backup' a user account. How to Migrate a Windows User to Different Windows 10 PC - HTG
    - Shared folders are identified in HKLM\SYSTEM\CurrentControlSet\Services\LanmanServer\Shares I only regard that Key as a source of information. I have no reason to believe that restoring the contents of that Key would result in the identified folders becoming shared.
    - I don't know of any Registry entries concerning file ownership.
    - I know nothing about Games.
    - What do you mean 'System properties'?


    Backing up specified Registry Keys is straightforward. You can use reg commands in a batch file to copy each desired Key. For example,
    Code:
    reg export HKCU\Whatever "H:\Backups\Registry\HKCU-Whatever.reg" /y >"H:\Backups\Registry\Backup.Log"
    Reg - SS64
    reg - MSLearn


    And there are tools for Registry backing up. See, for example,
    - dalchina's suggestion in Backup Registry Hives - TenForums
    - the ideas in Registry Backups - TenForums
    - the ideas in My Registry backup plan - TenForums


    Some Registry Key backups can be very large and NotePad or even Word can struggle with reading them. I read mine with NotePad++ instead.


    Denis
    Denis,

    The main purpose of backing up registry keys is to simplify the configuration of a different Win 10 install. That could be a fresh clean install of Windows on the same box, or to ensure consistency of settings on existing Win installs on different systems. Either way, I would speed up configuration operations and gain standardization.

    So far, I have saved registry settings for system name and drive shares and share names (which have to be edited for each different system). I have also saved the reg settings for Take Ownership, which presumably is the same across installs.

    By "System Properties" I mean some of the settings made through this window, which could ether be system-specific or the same across all systems:
    automatic or scripted backup of just selected registry keys-screen.png

    Beyond my own ideas, I got some great suggestions from the various links for additional reg settings. And I could also see saving reg settings for complex, option-heavy software like MS Office, Adobe Photoshop and Lightroom and even a utility like Beyond Compare.

    As a home-user I don't need to do Sysprep or that level of complexity, but reg settings, I'm all in favor of that.
      My Computers


  4. Posts : 17,038
    Windows 10 Home x64 Version 22H2 Build 19045.4170
       #4

    This spreadsheet might be a useful source for you
    Group Policy Settings Reference Spreadsheet for Windows 10 November 2021 Update [21H2] - MS
    I have not seen an updated version.


    Best of luck,
    Denis
      My Computer


  5. Posts : 282
    Windows 10 Pro
       #5

    Yes, I'd use the reg export command code in a batch file, save that and execute it via a scheduled task in Task Scheduler. I do this type of stuff all the time. But more advanced to automatic uploads to Amazon AWS S3 via the S3 Browser program, FTP servers via WinSCP and auto backups with FreeFileSync.
      My Computer


  6. Posts : 1,797
    Windows 10 Pro
    Thread Starter
       #6

    F22 Simpilot said:
    Yes, I'd use the reg export command code in a batch file, save that and execute it via a scheduled task in Task Scheduler. I do this type of stuff all the time. But more advanced to automatic uploads to Amazon AWS S3 via the S3 Browser program, FTP servers via WinSCP and auto backups with FreeFileSync.
    That all sounds impressive, but all I need is that batch script to copy to my backup drive. Scheduled of course.
      My Computers


  7. Posts : 17,038
    Windows 10 Home x64 Version 22H2 Build 19045.4170
       #7

    x509 said:
    That all sounds impressive, but all I need is that batch script to copy to my backup drive. Scheduled of course.
    I gave you that in post #2.
    Use that as a template command and repeat the line tailored for each Key you decide you want to export.
    Choosing which Keys to backup [export] is your choice.
    Regback.bat
    Code:
    reg export HKCU\Whatever "H:\Backups\Registry\HKCU-Whatever.reg" /y >"H:\Backups\Registry\Backup.Log"
    reg export HKCU\Whatever "H:\Backups\Registry\HKCU-WhateverElse.reg" /y >>"H:\Backups\Registry\Backup.Log"
    reg export HKCU\Whatever "H:\Backups\Registry\HKCU-WhateverX.reg" /y >>"H:\Backups\Registry\Backup.Log"
    reg export HKCU\Whatever "H:\Backups\Registry\HKCU-WhateverY.reg" /y >>"H:\Backups\Registry\Backup.Log"

    When you decide to automate it using Task scheduler than that is also straightforward.
    See Make Task scheduler run a batch file minimised and with a specific icon - TenForums which uses a batch file as its example.

    Denis
      My Computer


  8. Posts : 1,848
    Windows 10 Pro (+ Windows 10 Home VMs for testing)
       #8

    I'm going to suggest a fairly radical alternative to using reg.exe... PowerShell.

    My reasons?

    1. MS' preferred option rather than using legacy tools.
    2. Exposes the 'Current User' and 'Local Machine' registry hives as plain, old 'drives'... what more do you want? Oh, the Certificate store? Yep... exposes that as well, which reg.exe has never heard of.
    3. Fast... if there's a quicker way to get, for example, a list of installed printers available to the currently signed in user instead of just 2 simple cmdlets (Get-PSDrive followed by Get-ChildItem -Path 'HKCU:\Printers') then I don't know it (see screenshot below).
    4. Flexible... with parameters like -Force (which reg.exe knows about) and -Recurse (which reg.exe can only dream about).
    5. Scriptable... just like .BAT files.

    If you are looking to build a registry backup solution for selected branches (keys and subkeys) then I know which path I would be looking into... and it's not going to be using reg.exe.

    More info:
    Working with registry keys
    Managing PowerShell drives

    Registry
    about_Certificate_Provider

    Just my 2 cents...
    automatic or scripted backup of just selected registry keys-powershell_registry_drives.png

    Ask yourself this... what is Microsoft going to continue development for and/or access to the Registry API? A legacy tool or PowerShell?

    Hope this helps...
      My Computer


  9. Posts : 17,038
    Windows 10 Home x64 Version 22H2 Build 19045.4170
       #9

    .Reg file exports can be re-imported ["merged"]. They are backups not just containers of data.

    Denis
      My Computer


  10. Posts : 1,797
    Windows 10 Pro
    Thread Starter
       #10

    Try3 said:
    I gave you that in post #2.
    I know. I was just commenting on your more strutured approach,.
    Use that as a template command and repeat the line tailored for each Key you decide you want to export.
    Choosing which Keys to backup [export] is your choice.

    When you decide to automate it using Task scheduler than that is also straightforward.
    See Make Task scheduler run a batch file minimised and with a specific icon - TenForums which uses a batch file as its example.

    Denis
    - - - Updated - - -

    RickC said:
    I'm going to suggest a fairly radical alternative to using reg.exe... PowerShell.

    My reasons?

    1. MS' preferred option rather than using legacy tools.
    2. Exposes the 'Current User' and 'Local Machine' registry hives as plain, old 'drives'... what more do you want? Oh, the Certificate store? Yep... exposes that as well, which reg.exe has never heard of.
    3. Fast... if there's a quicker way to get, for example, a list of installed printers available to the currently signed in user instead of just 2 simple cmdlets (Get-PSDrive followed by Get-ChildItem -Path 'HKCU:\Printers') then I don't know it (see screenshot below).
    4. Flexible... with parameters like -Force (which reg.exe knows about) and -Recurse (which reg.exe can only dream about).
    5. Scriptable... just like .BAT files.

    If you are looking to build a registry backup solution for selected branches (keys and subkeys) then I know which path I would be looking into... and it's not going to be using reg.exe.

    More info:
    Working with registry keys
    Managing PowerShell drives

    Registry
    about_Certificate_Provider

    Just my 2 cents...
    automatic or scripted backup of just selected registry keys-powershell_registry_drives.png

    Ask yourself this... what is Microsoft going to continue development for and/or access to the Registry API? A legacy tool or PowerShell?

    Hope this helps...
    Actually I've never thought about that issue. There is this learning curve for PS, and I always seem to have to do something else first.

    That said, yeah, this sounds much better. I would have to learn PS, and now I have a reason to do that. Or at least enough of PS to get my reg backups done.
      My Computers


 

  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 00:25.
Find Us




Windows 10 Forums