This site is dedicated to my father and in his memory, endeavors to offer some small service to the world computing community.
  DOWNLOADS  ·  ENHANCEMENTS H O M E FIXES  ·  ARTICLES  
BOBSTUR'S BATCH FILE
A very knowledgeable friend and all around swell guy, Bob Sturtevant, created a very crafty batch file which gives you more control over restoring the Registry. This batch file overcomes the serious limitations of SCANREG by making many more backup copies of the Registry easily and readily available.

To look at it below you might think it is complicated, but in fact it's designed to be remarkably simple to use. If you're interested in how batch language works, take a look at how Bob manipulates the CAB files to first extract the four Registry files, and then change their properties so they can be used to replace your existing (presumably "broken") Registry. In fact, the bulk of the program is formatting so that in use, what you see is easily read and understood.

Download the zipped batch file to a temporary directory and then unzip it to your root directory. Once it's in the root directory just leave it there and forget about it until you need it.


A few preliminary notes:
  • You will see a table which will allow you to select which CAB file to restore from. So, for example, to restore from rb009.cab, you look at the table and see 09 corresponds to the letter J. You type the J and NOT the number.
  • This batch file assumes that your CAB files are stored in the default location, C:\WINDOWS\SYSBCKUP and that your Windows directory is C:\WINDOWS. If you have your Windows installation on another partition or located in some other directory then please edit the batch file accordingly.
  • Take a quick look in your C:\WINDOWS\SYSBCKUP directory and make sure that you currently only have CAB files in the range rb000.cab to rb014.cab. (Note: rb means Registry Backup.) If there are any other additional 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 that Ctrl+C will stop the program at any point, and you'll also be asked one last time if you want to restore the files.
  • 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, so don't worry if you're unsure which CAB to restore.
Having made those points clear, it's time to take a look at Cabrest.bat.



cls
@echo         ***Registry Restore by RLS***
@echo               Revised 7/19/01a
@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. (Ctrl-C to quit)
@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 letter for the "XY" 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 Hit Ctrl-Alt-Delete to reboot.
@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. Hit Ctrl-Alt-Delete to reboot or
@echo     enter 'cabrest' again to start over.
@echo.
:end


That's it. Simple, no? Once in your root directory just boot into pure DOS and simply type CABREST and press ENTER. The rest is cake.

Note: Please note that CABREST.BAT was updated on July 18, 2001. If you downloaded a previous version, please replace your old copy with this current version.


[Top of Page]
page 3 of 4

Back To Page Two Of How To Back Up And Restore Your Registry
On To Page Four Of How To Back Up And Restore Your Registry

 

  DOWNLOADS  ·  ENHANCEMENTS H O M E FIXES  ·  ARTICLES  
©Copyright 2002 · The Gazette · All Rights Reserved   ·   Webmaster   ·   Best Viewed With Any Standards Compliant Browser