View Full Version : how to restore the registry
I am running Windows 98 and I know how to change the "MaxBackupCopies" the registry checker keeps from 5 to a higher number. I have figured out where the additional backup copies of the registry are kept [<windir>\sysbckup by default]. However, how do I access one of these other copies to restore my registry to if need be since they are not kept with the 5 copies that are shown [located in DOS] when you restart your system in MS-DOS and type in scanreg /restore at the C> prompt?
I would greatly appreciate any assistance.
Thank You
POBrien
06-02-2000, 06:08 AM
You'll have to pull the ol' manual manuever.
Boot to dos.
As you know the registry is backed up into a cab file. The cab consists of system.dat, user.dat, system.ini and win.ini. The trick is to extract the four files overwriting the current files in the windows directory. Then a reboot does the job.
First you'll have to change the attributes on the sysbckup directory from hidden to un-hidden.
You can use a batch file to restore the cab file of your choice. Here's two examples:
This one just overwrites the files.
@echo off
cd windows
attrib sysbckup -h
extract /Y /E /L c:\windows rb005.cab
or... Here's one that backs up your files first. Then overwrites.
@echo off
cd\
cd windows
md mybackup
attrib system.dat -r -h
attrib user.dat -r -h
copy system.dat c:\windows\mybackup
copy user.dat c:\windows\mybackup
copy system.ini c:\windows\mybackup
copy win.ini c:\windows\mybackup
attrib sysbckup -h
extract /Y /E /L c:\windows rb005.cab
attrib sysbckup +h
You can copy an example into notepad and save the file with a .bat extension. ie: restore.bat. Then in dos type restore and hit enter. reboot.
You could go one step further and create multiple bat files and designate a specific cab file for each bat file.
restore5.bat
restore6.bat
restore7.bat
etc.
You can type extract /? in dos for additional switches to select from.
enjoy
Paul D
06-06-2000, 01:34 AM
Thanks to Bobstur at Windows Annoyances forum.
Cabrest1.bat follows. For starters, look it over for correct paths for your system. It assumes your CAB backups are in C:\WINDOWS\SYSBCKUP and your Windows directory is C:\WINDOWS.
Also to be compatible with this program, open SCANREG.INI and set
MaxBackupCopies=14, (not 15). Also, make sure that you currently only have
CAB files in the range rb000.cab to rb014.cab. If there are any other rb-cabs move them somewhere else.
The program must be run from real mode DOS (Command Prompt Only) and will intentionally abort if Windows is running.
Note in the program that CTRL-C will stop it at any point, and you'll also be asked one last time if you want to restore the files.
When you run the program the files will be listed in chrono order, most recent at the top, and will show the date/time of each.
Also important is the table that will appear where you select which file to restore from. So, for example, to restore from a CAB ending in 09, you look at the table and see 09 corresponds to the letter J. You type the J and NOT the number.
About the only thing you could do wrong would be to restore an older backup
when you didn't want to, but then you could just run the program again and restore the correct one.
START CABREST.BAT
cls
@echo ***Registry Restore by RLS***
@echo.
@echo This program will restore system.dat, user.dat, win.ini and
@echo system.ini files from the backup CAB file you select.
@echo It will create a C:\Windows\Temp3 directory and put the
@echo extracted files there. If this directory already exists,
@echo it will delete all files in it first.
@echo.
@echo ***Ctrl-C will stop the program at any time***
@echo.
@echo DO NOT RUN THIS WITH WINDOWS OPEN!
@echo.
@echo off
if not "%windir%"=="" goto WINDIR
choice /c:YQ Continue (Y) or quit (Q) ?...
if errorlevel 2 goto quit
smartdrv 8192 8192
cls
@echo Here are the files to choose from starting with most recent:
@echo off
DIR C:\WINDOWS\SYSBCKUP\*.cab /O:-D
@echo For the "XY" in RB0XY.cab, find the matching letter.
@echo 00 A 05 F 10 K
@echo 01 B 06 G 11 L
@echo 02 C 07 H 12 M
@echo 03 D 08 I 13 N
@echo 04 E 09 J 14 O
choice /c:ABCDEFGHIJKLMNO Enter the number for "X" you want.
if errorlevel 1 set num=00
if errorlevel 2 set num=01
if errorlevel 3 set num=02
if errorlevel 4 set num=03
if errorlevel 5 set num=04
if errorlevel 6 set num=05
if errorlevel 7 set num=06
if errorlevel 8 set num=07
if errorlevel 9 set num=08
if errorlevel 10 set num=09
if errorlevel 11 set num=10
if errorlevel 12 set num=11
if errorlevel 13 set num=12
if errorlevel 14 set num=13
if errorlevel 15 set num=14
@echo off
if not exist c:\windows\temp3 mkdir c:\windows\Temp3
deltree /y c:\windows\temp3\*.*
extract /L c:\windows\temp3\ C:\WINDOWS\SYSBCKUP\rb0%num%.cab user.dat
extract /L c:\windows\temp3\ C:\WINDOWS\SYSBCKUP\rb0%num%.cab system.dat
extract /L c:\windows\temp3\ C:\WINDOWS\SYSBCKUP\rb0%num%.cab win.ini
extract /L c:\windows\temp3\ C:\WINDOWS\SYSBCKUP\rb0%num%.cab system.ini
@echo.
choice /c:YQ Last chance - restore the extracted files (Y) or quit (Q)?...
if errorlevel 2 goto quit
cls
@echo off
attrib c:\windows\temp3\user.dat -r -s -h
attrib c:\windows\temp3\system.dat -r -s -h
attrib c:\windows\user.dat -r -s -h
attrib c:\windows\system.dat -r -s -h
copy c:\windows\temp3\user.dat c:\windows
copy c:\windows\temp3\system.dat c:\windows
attrib c:\windows\user.dat +r +s +h
attrib c:\windows\system.dat +r +s +h
copy c:\windows\temp3\system.ini c:\windows
copy c:\windows\temp3\win.ini c:\windows
@echo.
@echo Files were successfully restored from RB0%num%.cab
@echo.
goto end
:WINDIR
@echo Oops! YOU have Windows open.
@echo.
@echo Files were not restored.
@echo.
goto end
:quit
@echo Files were not restored.
@echo.
:end
END CABREST.BAT
<Font face="Brush Script MT" size=+3 color=#3366FF>Paul D</font>
[I]
To Paul D.
I do know that the additional backup files are in fact in C:\Windows\Sysbckup.
I have my maximum backup copies at 21. But why do you say to make it 14 and NOT 15? You also stated that if there are any other rb-cabs to move them somewhere else. Can I move them anywhere and are you talking about the ones that are in C:\Windows\Sysbckup or the ones located in MS-DOS?
I am sorry to be asking so many questions, however, I haven't even had my computer for a year yet and I am still reading and learning all I can.
Paul D
06-08-2000, 04:07 AM
"I have my maximum backup copies at 21. But why do you say to make it 14 and NOT 15?"
That was a cut and paste of an email sent to me. To be perfectly honest, I'm not quite sure why, but I think it's because they number from 000, not 001, so the 15th backup is 014.
"You also stated that if there are any other rb-cabs to move them somewhere else."
That means any numbered above rb014. For the batch file as presented to work, you need 15 backups, numbered 000 to 014.
"Can I move them anywhere?"
Yes, anywhere but C:\Windows\Sysbckup.
"Are you talking about the ones that are in C:\Windows\Sysbckup or the ones located in MS-DOS?"
There is nothing "located" in MS-DOS. It's all the same file system. When you run scanreg /restore or this batch file, it automatically goes to C:\Windows\Sysbckup for the files.
Keep asking. We all learn from experience.
<Font face="Brush Script MT" size=+3 color=#3366FF>Paul D</font>
[I]
reghakr
06-08-2000, 04:16 AM
If I had 21 backups I'd be using over 47MBs of space. With 21 backups aren't you a little confused as to what programs were installed and on what day you installed them. Sounds a little extreme to me!
reghakr
No I am not confused. To start with I am actually keeping a record of everything I do - installation wise that is. That may sound a bit extreme, however, I only had my computer for 4 - 5 months when the hard drive went, and then 4 months after I finally got it back, the motherboard and the hard drive had to be replaced. I have had all sorts of problems with this {my first} computer. I am hoping most of them were all related to the motherboard going bad and the hard drives going bad. Besides, I have a 19GB hard drive and not took much installed on the computer. Once I feel more comfortable I will change it to a more reasonable number like 14.
Powered by vBulletin™ Version 4.1.0 Copyright © 2012 vBulletin Solutions, Inc. All rights reserved.