Manually Restore the Registry From its Backup in Windows (Windows 7 / Vista)

Manually Restore the Registry From its Backup in Windows Vista or Windows 7

This tutorial provides instructions for replacing your current registry with a backup to fix a possibly damaged registry.

Warning

The following must be carried out exactly as stated here. Any deviation or change in output can further damage the Windows installation and require you to Clean Re-Install Windows 7 or Windows Vista.


  1. First, access the System Recovery Options.

  2. Next, open a command prompt.

  3. Check each drive's layout to find the Windows directory. It should appear similar to the following image:

    RR1_zpsc803cd39.png

  4. Change directories to the :\Windows\System32\ directory. In the below case, the drive letter was D:, so the result was the following command:

    Code:
    cd D:\Windows\System32

  5. Copy your config directory to a backup in case the next steps do not work.

    Code:
    D:\Windows\System32>mkdir configBackup
    
    D:\Windows\System32>copy config configBackup
    config\BCD-Template
    config\COMPONENTS
    config\DEFAULT
    config\SAM
    config\SECURITY
    config\SOFTWARE
    config\SYSTEM
    7 file(s) copied.


  6. Change directories to the config\RegBack directory:

    Code:
    cd config\RegBack

  7. Type the following command to see the directory contents:

    Code:
    dir

    The file sizes need to be the same or at least similar to the following image or this will not work.

    RR3_zps1e44596d.png

    Warning

    If there are any size 0 files, do not continue


  8. Copy the files from the RegBack directory to the previous directory:

    RR4_zpsd75a5348.png
 
Last edited:
Ok So I screwed up my registry file. Save it. So I typed in from a command prompt dir c:\win* and it shows Windows and Windows.old
SO I try to type in cd c:\windows and it doesn't do anything it still says X:\Sources. Anyone got any ideas how to get this to work?
 
Hi anaylor01. :welcome:

Short list of the actions to do:
  • get access to your system drive with an external disk/usb
  • open a command prompt (elevated, as administrator)
  • find the system partition (i.e., the correct system letter, because it might be different than the default c:)
  • create a new folder (where you prefer, but in the tutorial it's created inside the config folder) and copy there your current (damaged) registry files
  • go to the regback folder, where you should find a working (and some days older than the current) copy of your registry files
  • if there are 0 byte files, also those registry files must be considered damaged (therefore, you shouldn't procede to the next point)
  • copy the working registry files over the damaged ones (i.e., overwrite them)

Commands to run - the lines starting with ' are the explanations:
' change drive or partition
c:
' to ensure c: is the system partition, run dir: it should list windows, users, program files, etc, present in your system partition
dir
' if c: is not the system partition, you should do more tries; examples: d: or e: or f:, always followed by dir
' when you find the correct drive letter, you should use THAT letter when you see c:\ in the following commands
' change directory to system32
cd C:\Windows\System32
' you should now see your command prompt became c:\windows\system32>
' create the backup directory CurrentCorruptBackup (or configbackup, like writhziden said.. Just use your preferred name and keep it in mind you should use that name for the following three commands)

md CurrentCorruptBackup
' if you run dir now, you should see the new folder CurrentCorruptBackup
' copy the current config content, i.e. all corrupted registry files, to CurrentCorruptBackup

copy config CurrentCorruptBackup
' make sure the files were copied to the CurrentCorruptBackup folder
dir /a CurrentCorruptBackup
' change directory to regback, where a hopefully working copy of windows registry has been backed up by windows itself
cd config\RegBack
' you should now see your command prompt became c:\windows\system32\config\regback>
' to ensure there aren't any files with 0 as size, run dir. "If there are any size 0 files, do not continue"
' you should usually see five files here: DEFAULT, SAM, SECURITY, SOFTWARE, SYSTEM

dir
' copy these files to the parent directory C:\Windows\System32\config
copy * ..\*
' if you did it correctly, the prompt will ask you if you want to overwrite the files, and you'll answer yes to each one of the five files

' alternative command to use instead of the previous one
' remember to use the correct drive letter, found at first steps

copy * C:\Windows\System32\config\
 
Last edited:

Has Sysnative Forums helped you? Please consider donating to help us support the site!

Back
Top