TOCBACKFORWARD

Troubleshooting and Configuring
the Windows NT/95 Registry

-7-

Recovering from a Windows 95 Registry Failure

A Registry failure in Windows 95 isn't quite as dramatic as it is in Windows NT. Even though both have their own version of the Blue Screen of Death, Windows 95 is generally more forgiving when it fails.


WARNING: Restoring the Registry will overwrite the Registry that is there. For example, if you have a key that has five values in it, and overwrite the Registry with a key that only has four, only the four will be retained. Be very careful.

There are four levels of recovery from a Windows 95 Registry failure, and each has its own types of problems that it fixes:

Restart

Redetect

Restore

Reinstall

Let's look at each one individually to determine the most appropriate times to use it, and what types of problems are solved.

Restart the System

Much of the Windows 95 Registry is stored in RAM. If that information gets corrupted, it must be re-read in order to get correct information. When you restart the system, the Registry pulls the data off the hard drive into RAM where it will be used by the system.

An example of this problem is font IDs. Every font is known to the system with an ID number. When a font is used in a document, the font is stored by that number and labeled with a name. Figure 3.3 in Chapter 3, "Potential Registry Problems," is a perfect example of this problem. The font IDs got corrupted, and the font displayed and printed was not the one listed.

Restarting the system refreshes the data from the hard disk, the fixed font ID numbers are generated, and the fonts displayed and printed correctly.

An alternative would be to remove and reinstall all of the fonts on the system, but that would take much more time.

Redetect the Devices

If a device is acting inconsistently, the Registry settings that control the device may be corrupted. In order to reset the Registry, you could remove and reinstall the drivers, or you could ask Windows 95 to redetect them.

Many times, when a device is not working correctly, there will be a notification in the Device Manager. Figure 7.1 shows Device Manager with a device that is either in conflict with other devices or not working correctly.

Figure 7.1. The modem Registry information is incorrect.



NOTE: Obviously, if the device never worked, there can be other problems. But if the device was working, and now it is not, the Registry needs to be restored.

To redetect an item, select Add New Hardware in the Control Panel. The first question asked is "Do you want Windows to search for your new hardware?" as shown in Figure 7.2. If you choose Yes, Windows 95 will do an exhaustive search for "new" devices.

Figure 7.2. Device detection in the Control Panel.


Any device that is incorrectly configured, or whose driver is not found, will be detected and displayed.

Remove the old device and let Windows 95 use the new one.

Restore the Registry from a Backup

Depending on how you backed up the Registry, you can use many options to restore it.

Restore from Tape

Regardless of the program you used to back up the data to a tape drive, the procedure to restore it is the same. Figure 7.3 shows an example from Windows 95 Backup.

1. Open the program

2. Select the backup set.

3. Choose Restore.

Figure 7.3. Restoring data from Windows 95 Backup.


Depending on the program, you may be given options regarding overwriting files that are newer, overwriting files that have not changed, and selecting individual files and file types that should not be overwritten. As you can see in Figure 7.3, these options do not exist in Windows 95 Backup.

Restore from CFGBACK

Restoring the Registry from CFGBACK has many benefits. If you have created several backups, you can choose the precise one to use for the restoration. You can surgically place Registry entries, going back to a Registry that you know works well.

To restore from CFGBACK, highlight the backup you want to restore in the List of Previous Backups (as shown in Figure 7.4), and select Restore.

CFGBACK will overwrite the existing Registry. Be cautious in choosing the Registry that you want to use.

Figure 7.4. Restoring the Registry from CFGBACK.


Import Registry File

An alternative to using a "backup" is importing a .REG file that was exported earlier. The .REG file includes the location of the data, so simply double-clicking on the file will enter the data in the Registry. It is the simplest of all the restoration procedures, but also the one most prone to error. The error doesn't come from the data being written into the wrong place by REGEDIT.EXE; it comes from users double-clicking when they shouldn't.


WARNING: When you want to look at the contents of an exported Registry (with a .REG extension), do not double-click on the file. The .REG extension is associated with REGEDIT.EXE, and it will automatically import the data into the Registry without waiting for confirmation. If it is not the correct data, it can be devastating to the Registry. To edit the file, highlight it, and then right-click and choose Edit.


SOLUTIONS: How can I protect myself from someone accidentally overwriting my Registry by double-clicking on a .REG file? With most data files, when you want to change the association between the file and an application, you can hold the Shift key down, right-click on the data file, and choose Open With... to make the change. With a .REG file, you can do the same thing. As shown in Figure 7.5, highlight a .REG file, Shift+double-click, select Notepad to use to open the file, and click the option setting Always use this program to open this type of file.

Figure 7.5. Changing the default double-click action for a .REG file.


Then, if anyone double-clicks the.REG file, it will open into Notepad instead of automatically updating the Registry. You can still import the .REG file. Open REGEDIT.EXE, select Registry | Import Registry File, select the file and click Open, as shown in Figure 7.6.

Figure 7.6. Importing a .REG file in REGEDIT.EXE.


This change will protect your system from mistakes and allow more security.

Reinstall

The last resort is to reinstall the driver, application, or Windows 95. Usually, it only takes about an hour or so to reinstall just about anything. If you reinstall it over the current files, much of the configuration information would stay the same. In the case of drivers, you would need to reenter the configuration data.

Actually finding the cause and fixing it may take even longer than reinstallation, which is why reinstallation is a fairly common "solution" used by technical support. The main question is, "Do you want to find out what went wrong, or do you just want to make it work?" The answer to that may very well depend on who is asking the question, the frequency of the problem, and the availability of the software for reinstallation.


TIP: In most circumstances, you would remove drivers in the Control Panel. When you remove a driver in the Control Panel to reinstall it, do not click OK and exit between the processes of deleting the driver and reinstalling it. If you do, you will need to restart the system and reload the drivers from disk. If you simply take out the old driver and then add it back immediately (without leaving the dialog box), Windows 95 will reconfigure the settings and reload the information into the Registry without having to reinstall the driver.

Summary

There are several tools that allow you to restore the Registry in case of a failure. Your data will probably be safe, regardless of the method you use, with the exception of reformatting the drive. The best way to feel confident about recovering your system Registry is to have good backups.

TOCBACKFORWARD

© Copyright, Macmillan Computer Publishing. All rights reserved.