How To Back Up And Restore Your Registry In Windows 98 Before you get started, we recommend that you print this article and keep it near at hand. When you first saw the title of this article you may have been mildly curious, but you may not realize just how important the ability to backup the Registry can be. I see numerous posts in help forums desperate for a solution to what seems like insurmountable problems which could easily be completely repaired by restoring the Registry. But there is one more important use for this skill: Have you ever installed a program only to find that the installation routine has either gone terribly wrong or has made unexpected and unwanted changes and even uninstalling the program doesn't set it right? This is just the sort of "damage" that can be instantly undone with a simple Registry restoration. The beauty of it is that it's dead simple to do. This information will guide you through the steps required to backup and restore your Registry. We will go a step further here though; we will show you how to increase the number of back up copies of your Registry as well as provide you with a small, simple and extremely powerful program which allows you much greater control over how you manipulate these backup files. The Standard Set Up By default, Windows 98 will make a backup of your Registry just once daily, but only if you reboot during that calendar day. The standard setting keeps a backup for each of the previous five days only -- a rather limited number if you ever get into trouble. Also, if you don't reboot for an entire day, Windows will not create a backup. And it doesn't matter how often you reboot, only one backup will be generated per day. This is critical because you may, through program installations or direct manipulation, make significant changes to the Registry during the course of your computing sessions on any given day. If you wanted to restore a version of the Registry from a point after you had made changes during the day you would be unable to do so unless you have more backup copies at your disposal. Remember though, each new backup will replace the oldest one archived by Windows 98. Improving The Standard Set Up We recommend that you make more immediate copies of your Registry on an as needed basis. Make a backup copy just before beginning an editing session or installing any program, even small ones, which modify the Registry. That way, should the results of your edits have undesired effects or if you make an error, you can simply restore the copy from a few minutes before, even if your machine has been rendered unbootable by your edits or installation. Presto - you're back in business. That it is remarkably easy to do this should serve to encourage you to be diligent in backing up your Registry. We will also show you how to make more than five copies of your Registry a little later on in this article. For now though, let's start with the fundamentals. To Backup Your Registry In Windows 98: Click Start/Run, type SCANREGW and click OK. This will launch Windows' Registry scanner and backup utility. Once complete you will see a Registry Scan Results dialog box informing you of the results of the scan (it will tell you whether there were errors or not) and asking if you'd like to create a backup. Click the Yes button and Scanreg will replace your oldest backup with a current copy of the Registry. That's it. It's that easy. If you read no further than this you'll have learned how to backup your Registry when you want, rather than relying on Windows' single daily back up. But we have much more good information here for you, so read on! To Restore Your Registry: In order to restore one of your copies of the Registry you must boot into DOS. There are three basic ways to boot into pure DOS. If you are in Windows you can go to Start/Shut Down... and select Restart in MS-DOS mode. The computer will restart in pure DOS (not a DOS box in Windows - very important distinction). Alternately, if your computer is already off, you can start it into pure DOS by holding down the Ctrl key as soon as the BIOS information clears the screen. As soon as the menu appears, press the Space Bar (or any other key) once. This will keep the menu active and allow you the time to read over the selections available. Choose Command Prompt Only from the menu. You will then be in Pure DOS. If you are having trouble booting your computer, you can use your ERD (the Emergency Recovery Disk) to boot into DOS. Simply insert the disk into the floppy drive and reboot the computer. It will do all the work for you. Any of these choices will get you into pure DOS. Once there you can restore or even make another backup copy of the Registry. In order to restore any copy of the Registry, either a copy you made or one that Windows 98 itself made within the last five days, just type SCANREG/RESTORE. Using the arrow keys, select the CAB (the CABs you will see are archived copies of the Registry) you want. The CAB files are listed by date with the most recent copy at the top. Once you've restored the Registry, use the arrow keys to highlight Exit and then reboot. If you like, you can also create another backup in DOS by typing SCANREG/BACKUP. Then follow the prompt. This backup will work exactly like the one you made in Windows. There is no functional difference. You should now be able to boot back into Windows 98 normally, just as before you edited the Registry or had a problem. Now you know how to restore those back up copies you made. See, we told you there would be more good information. And we've just barely begun. Making Additional Backup Copies Of Your Registry The mechanism that Windows uses to control Scanreg is amazingly simple. It's just a plain text file called SCANREG.INI which you can easily edit with Notepad. When you run Scanreg, it first checks in this file to see if you've customized any of the available parameters such as the maximum number of backup copies, or where the copies are stored. To view and edit SCANREG.INI, simply click once on a blank spot on the Desktop Taskbar and press F3. Type SCANREG.INI in the Named: box, and type C:\WINDOWS in the Look in: box. Click Find Now and in a moment, when you see the file in the window simply double click it to launch it in Notepad. The standard version of SCANREG.INI should read something like this: ; ; Scanreg.ini for making system backups. ; ;Registry backup is skipped altogether if this is set to 0 Backup=1 ;Registry automatic optimization is skipped if this is set to 0 Optimize=1 ScanregVersion=0.0001 MaxBackupCopies=5 [We recommend changing this number to 14] ;Backup directory where the cabs are stored is ; \sysbckup by default. Value below overrides it. ; It must be a full path. ex. c:\tmp\backup ; BackupDirectory= ; Additional system files to backup into cab as follows: ; Filenames are separated by ',' ; dir code can be: ; 10 : windir (ex. c:\windows) ; 11 : system dir (ex. c:\windows\system) ; 30 : boot dir (ex. c:\) ; 31 : boot host dir (ex. c:\) ; ;Files=[dir code,]file1,file2,file3 ;Files=[dir code,]file1,file2,file3 Prudent computing dictates that a back up copy of SCANREG.INI should be saved in C:\WINDOWS\SYSBCKUP before you begin your editing session. Once this is done, change the value for MaxBackupCopies= from 5 to 14. Save and close SCANREG.INI. Now you're ready for the next step. When you practiced restoring your Registry in DOS as described above, you probably noticed that only four copies of the Registry are available to SCANREG. Even if you create more backup copies of your Registry as suggested above, you will only be able to access four of those copies. What's more, SCANREG will seemingly randomly choose any four copies. The obvious drawback is that you don't have access to all your carefully stored copies. What if you need one of the copies that SCANREG has not made available to you for restoration? Not to worry, we have a solution. 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 here you might think it is complicated, but in fact it's designed to be remarkably simple to use. We've made it available to you here in two formats: As text you can copy and paste into a plain text (Notepad) file and then save with the name CABREST.BAT in your root directory. Or you can download a zipped copy of the batch file. Save it in a folder on your hard drive. After the download is finished, unzip it to your root directory. Either way, 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 hit ENTER. The rest is cake. And For You Die-Hard Windows 95 Users Unfortunately none of this will work in Windows 95, unless you use our Special PC911 Registry Backup & Restore Upgrade Tool Kit for Windows 95. We've assembled all the files needed to enable you to use Windows 98 tools for backup and restoration of your Windows 95 Registry. Actually it's very simple, just a matter of copying some files and then running one REG file, so there's no reason not to do it. There are just six easy steps: Download the Special PC911 Registry Backup & Restore Upgrade Tool Kit for Windows 95 to an empty temporary directory. Unzip the contents of the archive into the same temporary directory. Copy SCANREG.INI and SCANREGW.EXE to your Windows directory (usually C: \WINDOWS). Copy SCANREG.EXE to your C:\WINDOWS\COMMAND directory. Copy CABREST.BAT to your root directory. Double click SCANREGW.REG to merge the required information into your Registry. You may now delete the temporary directory along with all the files contained within. The next time you reboot, SCANREGW will run invisibly in the background when your desktop appears; it will backup your Registry and then disappear. It will continue to do this, invisibly, once each calendar day. Of course, you will be able to backup and restore your Windows 95 Registry files exactly as described in the article above for Windows 98. Fortunately Microsoft saw fit to make the Registry backup/restore routine in Windows 2000 much easier. They've effectively made it even easier than this batch file makes it for Windows 98, so there is absolutely no reason why you shouldn't backup your Windows 2000 Registry before installing any software or editing the Registry. This aspect of Windows clearly points out the distinct progression Microsoft has made with each new operating system. There is always room for improvement though, so let's hope they keep working at it. Summary As you've seen, this whole process is much more difficult to explain than it is to use. Once you understand how to backup and then restore your Registry you can do it in a flash. The batch file provided should make it even easier. The versatility that this knowledge allows you should help you avoid problems or repair them quickly rather than end up stressing out because you have to reinstall Windows 98. Enjoy! http://www.pcnineoneone.com