Share via


C:\windows\system32\config\regback empty - batch file or command sequence to export registry in Windows 10?

Question

Wednesday, January 2, 2019 1:51 AM

I was doing some research on this and it seems that Windows 10 since at least 1803 no longer makes backup copies of the Registry hives and places them in C:\windows\system32\config\regback.  I also notice that the REG.exe command is available in the windows recovery environment(winre).  So my question is this. Since Windows 1809 no longer creates this backup I would like to be able to create a simple batch command file that I can run within the winre and make a complete copy/backup of the total registry, so I would then have a backup to restore from if need be.   If you can provide me with the reg save/restore commands, or reg import/export commands to accomplish this goal.  Also WHY doesn't windows 10 1803/1809 not perform this backup anymore anyway? bad move Microsoft!  System restore is not an option to do full registry backups as System restore has proven, at least to me to be faulty and flaky, but then that's just my 20+ years of windows experience. There used to be a REGBACK.exe in the old Windows NT Resource Kit that worked great but it's not available anymore either.   Using REG Export while windows is up does not create a complete total registry backup.

When you boot a Windows 10 PC via the Recovery Environment, are any of the registry keys locked? If not, could I use a simple xcopy command to copy the entire C:\windows\system32\config folder structure to say E: and if I wanted to restore them, just use the reverse and copy them back?    

Well, any help or assistance with this matter will be greatly appreciated. TIA      

Update: Can you do something like this in winre:

REG SAVE HKLM\COMPONENTS D:\RegBack\COMPONENTS
REG SAVE HKLM\SAM D:\Regback\SAM
REG SAVE HKLM\SECURITY D:\Regback\SECURITY
REG SAVE HKLM\SOFTWARE D:\Regback\SOFTWARE
REG SAVE HKLM\SYSTEM D:\Regback\SYSTEM
REG SAVE HKCU D:\Regback\NTUSER.DAT

REG RESTORE HKLM\COMPONENTS D:\RegBack\COMPONENTS
REG RESTORE HKLM\SAM D:\Regback\SAM
REG RESTORE HKLM\SECURITY D:\Regback\SECURITY
REG RESTORE HKLM\SOFTWARE D:\Regback\SOFTWARE
REG RESTORE HKLM\SYSTEM D:\Regback\SYSTEM
REG RESTORE HKCU D:\Regback\NTUSER.DAT

The above points to D: and not C; as in winre X: is the winre drive and D: is my actual C: drive

I would first enter D: at the x:. prompt to change directories

that would put me at D:\Windows\System32    the cd to D:\windows\system32\config

type:  Dir and that should show me all the Registry Hives?

I forget where the NTUSER.DAT file is specifically?

All replies (13)

Wednesday, January 2, 2019 7:30 AM

The registry database files you found are referred to as the hive and saving backup copies is the best way to backup the entire registry. There is also a user specific hive file in another location. 

All of this can be done manually but there are numerous free programs which automate the backup and restore. There are also plenty of articles describing the process and recommending such programs, for example:

https://www.raymond.cc/blog/backup-restore-whole-windows-registry-selected-hives/


Wednesday, January 2, 2019 8:18 AM | 1 vote

Hi,

If you can provide me with the reg save/restore commands, or reg import/export commands to accomplish this goal. 

I found a similar thread with several command lines provided:

https://stackoverflow.com/questions/24124790/exporting-entire-registry-to-relative-path

Please Note: Since the web site is not hosted by Microsoft, the link may change without notice. Microsoft does not guarantee the accuracy of this information.

Also for your reference:

/en-us/windows-server/administration/windows-commands/reg-export

When you boot a Windows 10 PC via the Recovery Environment, are any of the registry keys locked? If not, could I use a simple xcopy command to copy the entire C:\windows\system32\config folder structure to say E: and if I wanted to restore them, just use the reverse and copy them back?    

Yes, you can.

I forget where the NTUSER.DAT file is specifically?

Location: c:\users\user name

Note: check hidden items(this PC->view) to make it visible;

IF still invisible, navigate to this pc->view->options, uncheck hide protected operating system files.

Hope the information above can be helpful.

Best regards,

Lavilian

Please remember to mark the replies as answers if they help and unmark them if they provide no help.
If you have feedback for TechNet Subscriber Support, contact [email protected].


Wednesday, January 2, 2019 10:01 PM

Lavilian:

thanks for your response.

I tried the regedit /E D:\regback.reg command from your link and it creates an 85mb size file......Is there anyway to know from docs that this indeed backs up the entire Registry including user ntuser.dat?

This may solve the problem of backing up the registry, but then how would I rerstore using this regback.reg? Use REG Import Regback.reg I suppose?

Tia 


Wednesday, January 2, 2019 10:04 PM

But none of these programs will work from within winre...

neither hobocopy or shadowspawn will work in winre as they need visual C++ runtimes installed. That is not available in winre. thanks .


Thursday, January 3, 2019 8:40 AM

But none of these programs will work from within winre...

neither hobocopy or shadowspawn will work in winre as they need visual C++ runtimes installed. That is not available in winre. thanks .

You did not read the article properly.

You run the programs in Windows to create registry backups, not from the WRE. I use Registry Backup and Restore which as well as automating restore from within Windows places a simple script (regres.cmd) in the backup folder. If necessary you can run the script in the WRE to restore the registry.

If you want to backup the registry files from the WRE you can simply copy them from their two locations.

 


Friday, January 4, 2019 2:41 AM

Hi,

Please allow me to try to clarify the issue.

There is a mechanism named Last Known Good which can back up registry automatically through backing up five files: system, software, sam, security and default( under system32->config).

Last Known Good: https://blogs.technet.microsoft.com/askcore/2011/08/05/last-known-good/

In terms of no boot issue, we actually need only to backup two files of the five: system and software since registry will not be backed up automatically.

As for detailed steps:

CD D:\Windows\system32\config

 

Run the following command to rename the System and Software registry hive. 

**       Rename system system.old**

**       Rename software software.old**

Then enter the regback folder with the following command. 

**        Cd regback**

Run the following command to copy the system and software hive from the regback folder to the config folder.

 

**        Copy D:\windows\system32\config\regback\system D:\windows\system32\config\**

**        Copy D:\windows\system32\config\regback\Software D:\windows\system32\config\**

In addition, user profile wasn’t backed up and is of need to be backed up. Generally we create a new account to fix the corrupted user profile.

https://support.microsoft.com/en-sg/help/14039/windows-7-fix-corrupted-user-profile

Please help correct me if anything is misunderstood.

Best regards,

Lavilian

Please remember to mark the replies as answers if they help and unmark them if they provide no help.
If you have feedback for TechNet Subscriber Support, contact [email protected].


Friday, January 4, 2019 8:10 AM

Did you actually look at the files in D:\windows\system32\config\regback ?

On my Windows 10 (1803) machines the registry files are present but all are shown as zero bytes.

The article that you linked Last Known Good: https://blogs.technet.microsoft.com/askcore/2011/08/05/last-known-good/

dates from 2011 and is for OS up to Windows 7. It appears that for Windows 8, 8.1 and 10 that option is disabled by default but can be enabled by editing the registry: 

https://winaero.com/blog/how-to-restore-the-last-known-good-configuration-feature-in-windows-8-1/

However, it is not clear to me whether the LKG option is still readily available as a boot option from the (troubleshooting) boot menu even if you have enabled it in the registry.

Perhaps you could clarify further.


Monday, January 7, 2019 9:52 AM

Did you actually look at the files in D:\windows\system32\config\regback ?

On my Windows 10 (1803) machines the registry files are present but all are shown as zero bytes.

The article that you linked Last Known Good: https://blogs.technet.microsoft.com/askcore/2011/08/05/last-known-good/

dates from 2011 and is for OS up to Windows 7. It appears that for Windows 8, 8.1 and 10 that option is disabled by default but can be enabled by editing the registry: 

https://winaero.com/blog/how-to-restore-the-last-known-good-configuration-feature-in-windows-8-1/

However, it is not clear to me whether the LKG option is still readily available as a boot option from the (troubleshooting) boot menu even if you have enabled it in the registry.

Perhaps you could clarify further.

I knew that Last Known Good doesn't work on windows 10 1803 and the only reason why I linked that article was explaining the meaning of registry backup.

Please remember to mark the replies as answers if they help and unmark them if they provide no help.
If you have feedback for TechNet Subscriber Support, contact [email protected].


Monday, January 7, 2019 5:55 PM

Did you actually look at the files in D:\windows\system32\config\regback ?

On my Windows 10 (1803) machines the registry files are present but all are shown as zero bytes.

The article that you linked Last Known Good: https://blogs.technet.microsoft.com/askcore/2011/08/05/last-known-good/

dates from 2011 and is for OS up to Windows 7. It appears that for Windows 8, 8.1 and 10 that option is disabled by default but can be enabled by editing the registry: 

https://winaero.com/blog/how-to-restore-the-last-known-good-configuration-feature-in-windows-8-1/

However, it is not clear to me whether the LKG option is still readily available as a boot option from the (troubleshooting) boot menu even if you have enabled it in the registry.

Perhaps you could clarify further.

I knew that Last Known Good doesn't work on windows 10 1803 and the only reason why I linked that article was explaining the meaning of registry backup.

Please remember to mark the replies as answers if they help and unmark them if they provide no help.
If you have feedback for TechNet Subscriber Support, contact [email protected].

Yes but what about the first question in my post:

Did you actually look at the files in D:\windows\system32\config\regback ?

On my Windows 10 (1803) machines the registry files are present but all are shown as zero bytes.


Tuesday, January 8, 2019 6:11 AM

Did you actually look at the files in D:\windows\system32\config\regback ?

On my Windows 10 (1803) machines the registry files are present but all are shown as zero bytes.

The article that you linked Last Known Good: https://blogs.technet.microsoft.com/askcore/2011/08/05/last-known-good/

dates from 2011 and is for OS up to Windows 7. It appears that for Windows 8, 8.1 and 10 that option is disabled by default but can be enabled by editing the registry: 

https://winaero.com/blog/how-to-restore-the-last-known-good-configuration-feature-in-windows-8-1/

However, it is not clear to me whether the LKG option is still readily available as a boot option from the (troubleshooting) boot menu even if you have enabled it in the registry.

Perhaps you could clarify further.

I knew that Last Known Good doesn't work on windows 10 1803 and the only reason why I linked that article was explaining the meaning of registry backup.

Please remember to mark the replies as answers if they help and unmark them if they provide no help.
If you have feedback for TechNet Subscriber Support, contact [email protected].

Yes but what about the first question in my post:

Did you actually look at the files in D:\windows\system32\config\regback ?

On my Windows 10 (1803) machines the registry files are present but all are shown as zero bytes.

Hi,

If you come across with some problems, please post another thread in the forum for help.

Our policy is one question per thread.

Thank you for your understanding and cooperation in advance.

Best regards,

Lavilian

Please remember to mark the replies as answers if they help and unmark them if they provide no help.
If you have feedback for TechNet Subscriber Support, contact [email protected].


Tuesday, January 8, 2019 8:30 AM

Did you actually look at the files in D:\windows\system32\config\regback ?

On my Windows 10 (1803) machines the registry files are present but all are shown as zero bytes.

The article that you linked Last Known Good: https://blogs.technet.microsoft.com/askcore/2011/08/05/last-known-good/

dates from 2011 and is for OS up to Windows 7. It appears that for Windows 8, 8.1 and 10 that option is disabled by default but can be enabled by editing the registry: 

https://winaero.com/blog/how-to-restore-the-last-known-good-configuration-feature-in-windows-8-1/

However, it is not clear to me whether the LKG option is still readily available as a boot option from the (troubleshooting) boot menu even if you have enabled it in the registry.

Perhaps you could clarify further.

I knew that Last Known Good doesn't work on windows 10 1803 and the only reason why I linked that article was explaining the meaning of registry backup.

Please remember to mark the replies as answers if they help and unmark them if they provide no help.
If you have feedback for TechNet Subscriber Support, contact [email protected].

Yes but what about the first question in my post:

Did you actually look at the files in D:\windows\system32\config\regback ?

On my Windows 10 (1803) machines the registry files are present but all are shown as zero bytes.

Hi,

If you come across with some problems, please post another thread in the forum for help.

Our policy is one question per thread.

Thank you for your understanding and cooperation in advance.

Best regards,

Lavilian

Please remember to mark the replies as answers if they help and unmark them if they provide no help.
If you have feedback for TechNet Subscriber Support, contact [email protected].

My question asked if you tested the solution you provided for this thread.

I would still like to know the answer.


Wednesday, January 9, 2019 9:50 AM

Hi Rocketjetz,

Just checking in to see if the information provided was helpful. Please let us know if you would like further assistance.

Best Regards,

Lavilian

Please remember to mark the replies as answers if they help and unmark them if they provide no help.
If you have feedback for TechNet Subscriber Support, contact [email protected].


Friday, January 11, 2019 2:40 AM

Hi,

Just want to confirm the current situations.

Please feel free to let us know if you need further assistance.

Best Regards,

Lavilian

Please remember to mark the replies as answers if they help and unmark them if they provide no help.
If you have feedback for TechNet Subscriber Support, contact [email protected].