What's new

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


New member
Jan 30, 2017
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?


Staff member
Dec 31, 2013
World, Europe, Italy
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
' to ensure c: is the system partition, run dir: it should list windows, users, program files, etc, present in your system partition
' 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

' 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: