|
|
| 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:
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.
page 3 of 4
|
| DOWNLOADS · ENHANCEMENTS | H O M E | FIXES · ARTICLES |
| ©Copyright 2002 · The Gazette · All Rights Reserved · Webmaster · Best Viewed With Any Standards Compliant Browser |