![]() |
Scanreg: A Very Important Tool |
Windows 98
When you start your computer successfully, Windows Registry Checker (Scanreg.exe) creates a backup of system files and registry configuration information (including user account information, protocol bindings, software program settings, and user preferences) once daily. Files that Windows Registry Checker backs up include System.dat, User.dat, System.ini, and Win.ini. This article provides a description of the Windows Registry Checker Tool.
Windows Registry Checker automatically scans the system registry for invalid entries and empty data blocks when it is started. If invalid registry entries are detected, Windows Registry Checker automatically restores a previous day's backup. This is equivalent to running "scanreg /autorun" (without quotation marks) from a command prompt. If no backups are available, Windows Registry Checker tries to make repairs to the registry. This is equivalent to running "scanreg /fix" (without quotation marks) from a command prompt. If the registry contains more than 500K of empty data blocks, Windows Registry Checker automatically optimizes it.
Windows 98 Setup runs the Windows Registry Checker to verify the integrity of the existing registry before it performs an upgrade. If it detects registry damage, it tries to fix it automatically.
The protected-mode version of the Windows Registry Checker (ScanregW.exe) can create a backup of the system files and scan the registry for invalid entries. If invalid entries are detected, it refers to the real-mode version of the Windows Registry Checker (Scanreg.exe) for a resolution.
The Windows Registry Checker can be configured with the Scanreg.ini file. Settings that you can configure include:
Enabling or disabling the tool
The number of backups maintained (no more than five is recommended)
The location of the backup folder
Settings to add additional files to the backup set
Important Articles about using Scanreg.exe or Scanregw.exe
Command-Line Switches for the Registry Checker Tool
http://support.microsoft.com/support/kb/articles/q184/0/23.asp
How to Customize Registry Checker Tool Settings
http://support.microsoft.com/support/kb/articles/Q183/6/03.asp
"Out of Memory" Error Running Scanreg.exe with /Fix or /Restore
http://support.microsoft.com/support/kb/articles/q187/6/80.asp
Registry Checker Continues to Detect Registry Damage
http://support.microsoft.com/support/kb/articles/q186/9/09.asp
NOTE: To use Windows Registry Checker with the /restore parameter, it must be run from a command prompt running outside of Windows. When you do so, you can choose up to five registry backup files listed for you to restore.
To restore individual files, following these steps:
Click Start, point to Find, and then click Files Or Folders.
In the Named box, type "rb0*.cab" (without the quotation marks), and then click Find Now.
Double click on the cabinet file that has the correct file you want to restore.
Right-click the file you want to restore, click Extract, and then choose the folder where the new file is to be placed.
KNOWN ISSUES FOR WINDOWS REGISTRY CHECKER
If your registry contains an entry that references a file (such as a .vxd file) that no longer exists, it is not repaired by Windows Registry Checker. Such errors are not typically damaging, and if you want to you can manually remove the entry. For information about such errors, see the following article in the Microsoft Knowledge Base:
ARTICLE-ID:
Q132008
TITLE : Err Msg: Cannot Find a Device File That May Be Needed...
The amount of conventional memory required by the Registry Checker is determined by the size of your registry. You may require 580K or more of free conventional memory to complete the repair process. If you encounter an Out of Memory error message, optimize your free conventional memory. For information about optimizing memory, see the following article in the Microsoft Knowledge Base:
ARTICLE-ID:
Q134399
TITLE : How to Increase Conventional Memory for MS-DOS-Based Programs
NOTE: Extended memory is required for Windows Registry Checker to operate properly, so it does not run when you start your computer in Safe Mode Command Prompt Only. The exception to this is "scanreg /restore" which is the only scanreg function that can run without XMS memory.
ARTICLE-ID:
Q37242
TITLE : A General Tutorial on the Various Forms of Memory
ARTICLE-ID:
Q77083
TITLE : Optimizing Your Use of Upper Memory Blocks
ARTICLE-ID:
Q87165
TITLE : Command-Line Switches for MSCDEX.EXE
A little known fact, Windows 98 compresses the system registry automatically when it has more than 500k of "wasted space" in it. If you want to compress your registry manually, boot to an MS-DOS prompt (you must not be in Windows when you do this). To compress and optimize your registry, which is always a good thing to do anyway, type: "SCANREG /OPT" (without the quotes). Now, to backup the registry from the command prompt, type: "SCANREG /BACKUP" (without the quotes).
If you perform both operations, you have now compressed the registry as well as having backed it up. Okay, now I guess you're looking for something else right? Okay, try this.
Remember that Autoexec.bat file you don't need anymore, well now you have a new use for it. First, create a new folder on your hard drive, and name it regback. Now create a small batch file and call that batch file from the Autoexec.bat.
First, create a batch file named REG.BAT, and insert these lines: (This presumes that your hard drive is "C" and that you have created a new folder named regback).
COPY C:\WINDOWS\SYSBCKUP\*.CAB C:\REGBACK
C:\WINDOWS\COMMAND\SCANREG /OPT
C:\WINDOWS\COMMAND\SCANREG /BACKUP
Now save the batch file and call it from your Autoexec.bat file. Each time your system starts, your registry will be optimized and backed up and previous copies saved to the Regback folder. Every now and then clean out the Regback folder to save disk space, but remember, you will always have several registry backups to use in the event you need them to recover your system.
Courtesy of Dennis Waldron
By default, Win98 keeps the five most recent backups that Registry Checker creates. To increase the number of stored backups-which is always a good idea if you have available disk space-find the file SCANREG.INI, open it in Notepad and change the MaxBackupCopies= value from 5 to the number of your choice.
And While You're at It...
An undocumented SCANREG.INI file entry automatically backs up the files
of your choice along with the other Registry Checker files, but only if
those files reside in your root, C:\WINDOWS or C:\WINDOWS\SYSTEM directories.
To specify the files to back up, open SCANREG.INI in Notepad and add the
line Files= followed by the folder code (enter 30 for the root directory,
10 for the Windows directory or 11 for the System directory) and the filename,
separated by a comma. You can also add multiple files within a folder;
simply separate them with commas. For example, if you wanted to add the
SCANDISK.LOG and CONFIG.SYS files (located in your root directory) to your
Registry Checker backup, add the following line to your SCANREG.INI file:
Files=30, scandisk.log,config.sys.
Forget all of that confusion with RegClean (and its problems). If you are using Win98:
1. Shut down to a DOS prompt.
2. Enter cd \ at the C: prompt.
3. Type scanreg /fix
4. After this is finished click OK.
5. At the C: prompt enter: win
The Registry will be exported and redefined with a considerable saving in its size. Go to the Windows directory and find the System.dat and User.dat files and record their size. Run scanreg /fix, then go to the updated *.dat files and see the amount of savings in them.
There are other ways to backup your registry!!
(1) The registry is comprised of the two files: system.dat and user.dat. So you can simply copy these two files to somewhere safe. This is a useful way of taking a snapshot of the state of a machine before trying something potentially tricky. Copying back and re-booting restores the Registry back as it was.
(2) You can automate this procedure using a batch file. Make a c:\bat sub-directory, then run the following:
c:
cd \windows
attrib -r -s -h system.dat
attrib -r -s -h user.dat
copy system.dat c:\bat
copy user.dat c:\bat
attrib +r +s +h system.dat
attrib +r +s +h user.dat
This removes the file attributes from system.dat and user.dat so that they can be copied, and then restores the same attributes after the copying is done. Note that this batch file only saves the most recent copy of the Registry because subsequent executions of the batch file will replace the previous copies.
(3) You can also rely on the backup that is made automatically during the first boot of any day - or which you can force by running scanregw.exe. This backs up into a regnnn.cab file in windows\sysbckup, keeping the latest five such backups; and you can restore by booting to a Command Prompt and using SCANREG /RESTORE, which will offer the available ones to choose from.
(4) Explanation of Win98 Backup
Each time, win98 backup its registry and system.dat and user.dat in a file cabinet and stored in directory C:\windows\sysbckup\rb00*.cab
By default, win98 will keep up five cabinets as files:
rb000.cab ... rb005.cab
Each cabinet contains 4 files: system.dat, system.ini, user.dat, win.ini
If restoring the registry of oldbackup, go to the command mode when restarting the computer just after ram testing but before the logo of windows appear, press <CTRL> key.
At c:\prompt, type 'scanreg/restore' without quote , press <enter>
It will pop up the backup cabinets rb000.cab .... rb005.cab , where
the highest number is the latest backup.
Select rb005.cab ( or more older backups cabinet rb001.cab or rb000.cab ) and confirm OK, then the captioned 4 files will be replace and restore from the backup.
It should be done with all 4 files to be restore, otherwise system will
be incompatible.
-------------
Suggest
: enable daily scanregistry at the Msconfig - StartUp page.
[x] ScanRegistry C:\windows\scanregw.exe /autorun
-------------
Then use windows explorer to examine c:\windows\sysbckup\ rb000.cab
27/05/99 which is registry update daily at startup of computer
rb001.cab 28/05/99 which is registry update daily at startup of computer
rb002.cab 30/05/99 which is registry update daily at startup of computer
rb004.cab 30/05/99 which is registry /fix or registry checker update.
rb005.cab 31/05/99 which is registry update daily at startup of computer
rbbad.cab 30/05/99 which is detected some errors on the original rb003.cab,renamed
-------------
Before installation of new software or adjustment of system, within
the date (as registry only autorun updating on the next date as you startup
the computer) use Registry checker update the current settings. (eg. rb002.cab)
If installation has problem the new registry rb003.cab turns bad and renamed rbbad.cab.
If you want to restore old registry, then at the command mode,at c:\ prompt, type "scanreg /restore" (without quotation), <enter> then select restore the rb002.cab to restore the original last registry.
-------------
If you still find the system have registry registration error, try
to remove these (5) cabinets to other subdirectory. Then go to command
mode, at c:\ prompt, type "scanreg /backup" (without quotation), <enter>
, new cabinet will be created at the sysback directory which is then act
as counter previous record in the registry against any changes to your
current registry.
The one made by windows registry checker is optimized (compressed) to about 800-950kb.
(5) Use the Microsoft program RegBack.exe. It will make any number of backups with a name of whatever you choose. It's easy to use and is especially useful when SafeMode is launched because of an error.
See
Important
Articles about using Scanreg.exe or Scanregw.exe
Each day, after a successful boot, a backup copy of your registry is created (containing the System.dat, User.dat, System.ini and Win.ini files). By default Windows 98 allows you to keep up to 5 copies (rb???.cab - rb???.cab) of your registry (which are saved in the \Windows\Sysbckup folder by default), saved in Windows cabinet files (*.cab).
When Windows notices a problem with your registry, it will automatically replace the registry with a backup copy. The good thing about this new feature is that you can easily restore a previous registry "MANUALLY":
1.Start Windows in MS-DOS mode (press the Ctrl key as soon as your PC starts. This will get you the Bootup menu. Once the menu is up, choose Command prompt only)
2.Type Scanreg /restore at the prompt
3.You will get a screen where you can select which registry backup to use
4.Choose your backup and press Restore
5.When ready you'll be prompted to Restart your computer
If you receive an Out of Memory error message when you try to run Scanreg with the /restore (or /fix) switch, you need to free conventional memory. ScanReg needs 340KB or more conventional memory, depending on the size of the registry and the amount of damage.
To increase the amount of free conventional memory, restart your computer, press and hold down the Ctrl key until the Windows 98 Startup menu appears, and then choose Safe mode command prompt only. Then, run Scanreg.exe with the /fix or /restore switch.
Now for those of us who regularly install Shareware programs, only to find after a day that the don't bring what we expected, this is a great way to keep the registry clean. Before you install a new piece of software, run ScanReg (click Start > Run and type scanreg in the Open dialog box. Windows will scan your registry, and when it doesn't find any errors, will prompt you to back-up your registry. At this stage you would choose Yes.
Now if you find after a day that you don't like the program you installed, just uninstall the program in the normal way (see the help- or readme file accompanying the program) and restore the registry you made just before you installed the program, using the method described above.
Switch | Description |
/autoscan | Automatically scans the registry and backs it up without displaying any prompts if there is already a backup for that date. |
/backup | Backs up the registry and related files without displaying any prompts. |
"/comment=<text>" | Enables you to add a descriptive comment to the registry backup. |
filename | Scans the registry file specified and displays a message indicating whether or not any errors were found. This switch does not back up the registry. |
/fix | Repairs any damaged portions of the registry, and optimizes it by rebuilding it without unused space. |
/restore | Displays a list of available backup files, sorted by the date and time the backup was created. |
/scanonly | Scans the registry and displays a message if any errors are found. This switch does not back up the registry. |
The "/comment=<text>" switch can be used by itself or with the /backup switch. For example, you can type either of the following commands at a command prompt:
scanreg.exe "/comment=registry backup 7 October"
scanreg.exe /backup "/comment=registry backup 7 October"
The first command line starts the Registry Checker tool graphical user
interface (GUI) and prompts you to create a registry backup. The second
command line creates a backup copy of your registry and adds your comment
without starting the Registry Checker tool GUI.