Command line Parameters for SCANREG

The Registry Checker Tool arrived with Win98/Me, and makes it easy to backup or restore the registry. The DOS version of the Registry Checker (Scanreg.exe) has the following command line switches:

Scanreg.exe [/backup] [/restore] [“/comment=<text>”] [/fix] [/opt]

  • /backup - backups the registry (System.dat and User.dat), System.ini and Win.ini
  • /restore - brings up a list of backed up registries and lets you select which you want to restore (Only the 5 earliest backups are displayed)
  • /comment - lets you add a comment when backing up your registry
  • /fix - fixes any errors and removes unused spaces by rebuilding the registry
  • /opt - optimizes the registry by removing any gaps larger than 500 KBytes
  • /autoscan - Scans the registry and creates a backup without prompting user
  • /scanonly - Scans the registry for errors without making any changes

The Windows version of the Registry Checker (Scanregw.exe) has the same switches, but it cannot optimize or restore the registry. By default when Windows starts the Registry Checker is launched like this:

Scanregw.exe /autorun

  • /autorun - Makes a silent registry check. If registry is good then a backup is made and it quits. If registry is bad then scanreg is set to make a restore at next boot and the machine is restarted.

Note that in Windows Me it is also possible to use SCANREG inside a DOS prompt, it will then restart to commit the changes. One can also do it directly from DOS by booting from a Windows Me startup disk.

Note there is a file called Scanreg.ini, which resides in the Windows directory. It contains parameters for how the Registry Checker should perform it’s backup operation.

Scanreg.ini OptionDescription
Backup=A value of 1 (default) causes a backup to be made once a day if the computer is started. A value of 0 disables automatic backups to be made.
Optimize=A value of 1 (default) causes it to automatically optimize your current registry if required. A value of 0 disables optimizing of the registry.
MaxBackupCopies=A value of 5 (default) causes it to save the last 5 registry backups (max 99).
BackupDirectory=Have no value by default and causes registry backups to be saved in the Windows\\Sysbckup folder. To change the location of where to make backups, change the value to fx. **c:\\registry\\backups**
Files=Have no value by default and causes only system files to be saved. To specify additional files add one or more Files= entries using this syntax:
Files=<folder code>,<file name>,<file name>...
The following folder codes can be used: - 10 - Windows folder - 11 - Windows\\System folder - 30 - Root folder (C:\\) - 31 - Root host folder (C:\\) Ex.:

More Info MS KB184023
More Info MS KB183603
More Info MS KB183887
More Info MS KB198864
More Info MS KB201655
More Info MS KB245147