Sunday, February 8, 2015

One key backup/restore your registry in Windows XP/WIN7/WIN8


One key backup/restore your registry in Windows XP/WIN7/WIN8

Windows XP for sample : the registry physical files and folders in Windows XP :
================================================================================
C:\Documents and Settings\Administrator\
C:\Documents and Settings\All Users\
C:\Documents and Settings\Default User\
C:\Documents and Settings\LocalService\
C:\Documents and Settings\NetworkService\

Ntuser.dat
ntuser.dat.LOG
ntuser.ini
================================================================================
C:\Documents and Settings\Administrator\Local Settings\Application Data\Microsoft\Windows
C:\Documents and Settings\All Users\Local Settings\Application Data\Microsoft\Windows
C:\Documents and Settings\Default User\Local Settings\Application Data\Microsoft\Windows
C:\Documents and Settings\LocalService\Local Settings\Application Data\Microsoft\Windows
C:\Documents and Settings\NetworkService\Local Settings\Application Data\Microsoft\Windows

Usrclass.dat
UsrClass.dat.LOG
ntuser.pol
================================================================================
C:\WINDOWS\system32\config\

All files in this folder .
================================================================================
(or it may be have a supplement .)

You can learn all above in google 。



So here is the bat code for backup all your registry physical files :
================================================================================

@echo off
@echo backup all your registry physical files .
%~d0
md "Main_Disk\WINDOWS\system32\config"
xcopy /E /H "%~d0\WINDOWS\system32\config\*.*" "Main_Disk\WINDOWS\system32\config"
md "Main_Disk\Documents and Settings"
xcopy /S /H "%~d0\Documents and Settings\*"NTUSER.DAT "Main_Disk\Documents and Settings"
xcopy /S /H "%~d0\Documents and Settings\*"ntuser.dat.LOG "Main_Disk\Documents and Settings"
xcopy /S /H "%~d0\Documents and Settings\*"ntuser.ini "Main_Disk\Documents and Settings"
xcopy /S /H "%~d0\Documents and Settings\*"UsrClass.dat "Main_Disk\Documents and Settings"
xcopy /S /H "%~d0\Documents and Settings\*"UsrClass.dat.LOG "Main_Disk\Documents and Settings"
xcopy /S /H "%~d0\Documents and Settings\*"ntuser.pol "Main_Disk\Documents and Settings"
pause

================================================================================
save codes above to REG_Backup.bat,and then copy bat file to C disk , run it。
Restore method : open folder "Main_Disk",Ctrl+A to select all,Ctrl+C to copy,back to C disk,Ctrl+V to paste .
But do not copy your registry backup to your desktop , or bat will backup the registry files in your desktop .



But !!! Because of the registry physical files are in used by other process , it will cause a problem like this :


Here is the solution :
Before running REG_Backup.bat,you must have two partitions divided in your hard disk , and both have operation systems installed .
If you want to backup the registry of system installed in partition 1 , you must run system installed in partition 2 at first .
And then copy REG_Backup.bat to partition 1 , run it .

So , backup or restore the registry of system installed in partition 1 , you must run system installed in partition 2 at first .

WIN7/WIN8 and other microsoft systems is the same way to do it .


Enjoy yourself !

No comments:

Post a Comment