All About Scanreg


Okay, if you've read an earlier tip, you're probably asking what it ScanReg and what is so important about it.

There quite a bit of pro and con about Microsoft and what they have done right and wrong, and if they've done anything right at all, it is their inclusion of this tool. Some background on this neat hidden little tool as well as its use both inside and outside of the Windows 98 GUI interface.

Windows 98 comes with not one, but two Scanreg files, Scanreg and Scanregw. Scanreg is used within MS-Dos and from a dos prompt, while scanregw is used within Windows 98 and called from the "Start", "Run" command line.

ScanReg (Registry Checker) is an automated registry verification and backup utility that is provided with Windows 98. The ScanReg.ini file is a Windows system file that contains configuration information for the way that ScanReg runs.

ScanReg also has a neat little companion tool called Sredit.exe that enables you to configure Scanreg to work in the manner you wish. As an example, in addition to backing up the registry (user.dat and System.dat), including the Win.ini and System.ini files, you can add several other files to the registry backup as well. SREdit.Exe allows you to alter the default configuration settings for the ScanReg program.

Get Sredit.exe Download HERE

The SREdit tool can be found in the Config folder on the Windows 98 CR-ROM as well as part of the Windows 98 Resource Kit.

SREdit.Exe works by modifying the ScanReg.Ini file, eliminating the need for the user to modify this file directly. This can be useful for creating emergency recovery disks as well as optimizing the performance of your computer.

With SREdit.Exe, you can make the following changes to the way that ScanReg runs:

You can specify the directory or directories where ScanReg stores its backup copies of the Registry.

You can set the maximum number of backup copies allowed as well as select additional system files (such as AutoExec.Bat, Config.Sys, or Msdos.sys) to be backed up.

You can set ScanReg to optimize the registry. (When this value is set, ScanReg removes the space reserved in the registry for deleted keys, which typically reduces the size of the registry.)

As you know, the registry is critical to your Windows 98 based computer because Windows 98 and Windows 98 based applications store their configuration information in the registry. Therefore, it is crucial to back up the registry regularly and frequently so that this information can be recovered in the event that the registry is damaged. It is also a good idea to back up the registry before installing a new application or new hardware.

Registry Checker automatically backs up and restores the registry. You can also run it manually at any time using the following procedure.

To manually back up the registry using Registry Checker:

On the Start menu, click Run.

Type scanregw.exe, and click OK.

First Registry Checker verifies that the registry is structurally sound. If the registry is found to be sound, Registry Checker offers to back it up. Registry Checker will back up the registry and store the compressed CAB file in \Windows\Sysbckup directory (a hidden directory).

On those occasions where the registry structure is sound, but a content change in the registry is keeping the computer from booting properly, you will need to manually restore the registry and maybe other critical boot files from a backup. You would accomplish this by using the following procedure:

To restore the backup manually:

On the Start menu, click Shut Down.

Select Restart in MS-DOS mode and click OK.

At the MS-DOS command prompt, type "scanreg /restore" (without quotes).

Select the latest known good backup.

Backed up, compressed registry files are listed with the name Rbxxx.cab. The files show the time and date of backup. Next to each CAB file are the words Started or Not Started.

"Started" means that the file has successfully started Windows 98, and is a known good file. "Not Started" means that the file has never been used to start Windows 98, so it is not a known good file. This doesn't mean that it isn't a good registry backup, but only that it has never actually been used to start Windows 98.

The syntax for the backup would be:

C:\Windows\Command>SCANREG /BACKUP /COMMENT="MESSAGE"

The syntax to either view the backup with message and/or restore would be:

C:\Windows\Command>SCANREG /Restore

or

C:\Windows\Command>SCANREG (and then view the backup files)
*************************
The Registry Checker scan and backup tools can be configured with the Scanreg.ini file, which in itself can be edited using the Sredit.exe file.

Configurable settings in the Scanreg.ini file:

Backup= Enables and disables Registry Checker.

Backup=0 Disables backups

Backup=1 Enables backups

MaxBackupCopies= Specifies the maximum number of backups to store in the Backup folder.

MaxBackupCopies=5 5 is the default number of copies.

BackupDirectory=

Changes the location of the backup folder where the CAB files are stored. For example,

BackupDirectory= C:\RegBackup.

Files= Adds system files to be backed up.

The "File=" entry does not exist by default, and is used to specify additional files you want to back up in the .cab file. To specify additional files to be backed up, type "Files=<folder code>,<file name>" (without the quotation marks), where <folder code> is the numerical code for the folder in which the file you want to back up is located, and <file name> is the name of the file you want to back up. If you want to back up multiple files in the same location, separate each file name using a comma (,) and no spaces.

The following table lists the possible folder codes:

Folder code Folder
------------------------------------------------------
10 <windows> (for example, Windows)

11 <windows>\System (for example, Windows\System)

30 Root folder (for example, c:\)

31 Root host folder (for example, c:\)

As an example, if you want to back up the 3d Maze.scr and Actmovie.exe files located in the Windows\System folder, type the following line:

Files=11,3d maze.scr,actmovie.exe

Optimize= Enables and disables automatic registry optimization.

Optimize=0 Disables optimization

Optimize=1 Enables optimization
*************************
The following are the command line options for "ScanReg" (Registry Checker)

Some options apply to ScanReg only, ScanRegw only, or either.

MS-Dos only!

ScanReg [/backup] [/restore] ["/comment=<text>"] [/fix]

Windows 98 only!

ScanRegw [/backup] ["/comment=<text>"] [/fix] [/autoscan] [/scanonly] [filename]

/backup Backs up the registry with no prompts to the user.

/restore Displays a list of backup files available, sorted by date and time of the backup.

/comment= Specifies that a comment is attached to the backup, which is displayed with /restore.

/fix Repairs the registry files.

/autoscan Scans the registry files every time it is run, but only backs up once per day.

/scanonly Scans the registry files and returns an error level. Does not back up.

Filename Scans the registry file specified and displays a message indicating whether

Or not any errors were found. Does not backup the registry.

Note: The registry scan results dialogue only appears when used within Windows 98.

This table identifies the error levels returned by ScanReg.
*******************************************
Error level Error

2 The registry is bad.

0 No problems found.

-2 Not enough memory. Free some memory. In real mode, Registry Checker may require more memory, or high memory (HIMEM) needs to be installed (ScanReg does not work in Safe Mode command prompt only). In protected mode, the Windows drive may be full.

-3 File not found. One or both of the registry files are missing.

-4 Unable to create User.dat or System.dat.

-5 Reading the registry failed.

-6 Writing to the registry failed.

-7 Sharing violation (protect mode only). Another application has the registry open.

Caution: You must not back up core configuration files using the Emergency Recovery utility and CfgBack utilities from the Windows 95 compact disc. If these Windows 95 backup registries are restored to the Windows 98 system, the computer will not boot.

Quite often when viewing instructions on a web page, delineating where spaces should be is sometimes difficult. With that I'll provide an example of using the "message" appended when creating the backed up registry file.

For this example, let's presume that you have a clean Windows 98 install and you have everything working just as you want it. Now you want to add a new program such as Norton or McAfee Anti-virus and you want to insure a way back if there are problem.

Question, how do you tell which registry backup is the one immediately preceding the installation of the anti-virus program? Easy, append a message to it!

Note: The underscore "_" between words represents a blank space!

C:\>SCANREG_/BACKUP_/COMMENT="B4NORTON"
Back To The Top

Bud's CDs FREE MP3s     Alphabetical Index Of Everything In This Site