3.4. Software in the Registry
If you look at the exam objectives that Microsoft provides, you won't find the Registry under the software heading; you'll find it under the configuring Windows 95 heading. The reason for covering it here is that, not only have I already mentioned the Registry, but also I will mention it even further in the next couple of chapters.
The Registry is a hierarchical database where Windows 95 keeps its configuration of hardware, software, user specific settings, and so on. It replaces the need for AUTOEXEC.BAT, CONFIG.SYS, and INI files. Windows 95 still maintains a copy of these files for backward compatibility. Additionally, Windows 95 will load any real-mode drivers mentioned in these files that weren't converted during setup.
The Registry comprises two files: SYSTEM.DAT and USER.DAT. The SYSTEM.DAT contains all system specific information. Likewise, the USER.DAT contains all the user-specific information. If profiles have been enabled, each user who logs onto Windows 95 will have his or her own individual USER.DAT created.
As mentioned in Chapter 2, the SYSTEM.DAT and USER.DAT are automatically backed up as SYSTEM.DA0 and USER.DA0.
You can find these files in the Windows directory. If profiles have been enabled, each user will have a directory created to store his or her settings. That person's copy of the USER.DAT is stored in that directory. I'll talk more about profiles in Chapter 5.
You can view and edit the Registry directly by using the program REGEDIT.EXE.
TIP
You may be asked how to invoke the Registry Editor on the exam. You should know that REGEDIT.EXE is the command line for starting it.
NOTE
Be careful with the Registry Editor. When you make changes in it, most of them are dynamic. In other words, the change takes effect immediately.
If you can modify the configuration through some other means, such as the Control Panel or the System Policy Editor, you should do so. Only use the Registry Editor to modify the configuration when you have to.
NOTE
It isn't like the old INI files where you can experiment and see what happens. Modifying the Registry incorrectly could have systemwide effects that you may only be able to repair by reinstalling Windows 95.
3.4.1. How applications use the Registry
Applications store their configuration information in the Registry. When they are written specifically for Windows 95, they update the Registry automatically upon installation.
Older applications, such as Win16 applications that still need the INI files such as WIN.INI and SYSTEM.INI, are handled a little differently. If you upgraded Windows 3.x with Windows 95 (installed it into the same directory), Windows 95 took the settings in the INI files and updated them into the Registry. If you installed Windows 95 into a separate directory, you need to reinstall all applications in order for them to be stored properly in the Registry.
3.4.2. Structure of the Registry
You can see by Figure 3.19 that the Registry is broken down into six keys of information called the root keys. These root keys have a similar look and feel of a directory structure. There are subkeys inside of subkeys similar to subdirectories inside of subdirectories. Table 3.1 provides a breakdown of what each key contains.
Figure 3.19. The Microsoft Registry Editor.
Table 3.1. Windows 95 Registry Keys.
Key |
Contains... |
HKEY_CLASSES_ROOT |
OLE and file associations. |
HKEY_USERS |
information about all users of this computer. |
HKEY_CURRENT_USER |
user-specific information about the currently logged on user. This key is created at log on. |
HKEY_LOCAL_MACHINE |
machine-specific information: drivers, hardware, etc. |
HKEY_CURRENT_CONFIG |
storage of multiple configurations such as when a laptop docked or undocked in a docking station. |
HKEY_DYN_DATA |
the dynamic status of devices. Used for Plug and Play configuration. Created at boot up and not part of either of the Registry files. |
TIP
Even though you do not need to memorize every single piece of information that is stored in the Registry and where it's stored, it is important that you know what each HKEY contains.
3.4.3. Storing Registry values
In Figure 3.20, you'll see the configuration of the user who's currently logged onto this machine. I've expanded several of the subkeys on the left so that you can see the directory-like structure. On the right, you'll see some sample values of that subkey. The three values at the top are legitimate, whereas I plugged in the three at the bottom, beginning with the word sample, to show you the three types of values. The values consist of a value name and the actual data of that value.
Figure 3.20. Adding values in the Microsoft Registry Editor.
The Binary value is of course, a binary number. The DWORD value is also a binary value, but the data of a DWORD value is hexadecimal. A program or hardware device sets both of these types of values. Even though you can edit them, it's a good idea to leave them alone.
A String value, however, can be helpful in troubleshooting and configuration. In the next section, I'll give you an example.
3.4.4. Searching the Registry
If you haven't by now, expand out some of the keys and see just how overwhelmingly big the Registry is. Finding a specific value that you may need is like looking for a needle in a haystack. Like most Microsoft programs, a search option will help. By clicking on the Edit menu option (Figure 3.21), you'll see the Find option.
Using the Find option, I am going to search for the string sourcepath. This particular search provides the result that you see in Figure 3.22. Notice the path to this particular key at the bottom of the dialog box.
Figure 3.21. The Find option of the Registry Editor.
Figure 3.22. Results of the Registry search.
NOTE
By the way, the source path is where Windows 95 looks for the installation files. This is a very handy thing to change. Did you install from a CD-ROM? If so, do you hate it whenever you make a change that requires the CD-ROM and you have to go hunting for it?
NOTE
If so, copy the contents of the WIN95 folder from the CD-ROM down to the hard drive. Then, change this key to point to that new location. From then on, Windows 95 will get the required software from that directory.
3.4.5. Editing the Registry values
Once again, I must caution you on editing the Registry. Only change the values if you know what the outcome will be.
Editing the Registry values is as simple as double-clicking on them. When I double-click on the source path value, the dialog box in Figure 3.23 appears. As you can see, you can change the string value simply by typing in the new value. The editing dialog box that appears will vary depending on the type of value that you are editing.
Figure 3.23. Editing a string value in the Registry.