
The Registry is the central information storage area for all the data Windows 98 and its applications need. It contains all hardware, software, and operating system configuration information, including all information about any Plug and Play devices ever attached to the computer, object linking and embedding (OLE) information for the system, and all applications that support embedding and drag-and-drop, network configuration and bindings, and individual user profiles.
This chapter describes the Windows 98 Registry and how Windows 98 uses Ini files by covering the following topics:
You can use software applications, such as Control Panel applets, to modify the Registry. You also can use the Windows 98 Registry Editor to manually modify the Registry. You shouldn't attempt the latter, however, unless you know exactly what you're doing.
WARNING: The Registry contains dynamic information that the hardware, operating system, and applications that run in Windows 98 all use. Incorrectly modifying this information can cause hardware, applications, and Windows 98 to run improperly or fail to run at all. Don't modify the Registry unless absolutely necessary, and always make a backup before you make any changes. You can use the Microsoft Configuration Backup (CFGBACK) utility and Emergency Recovery Utilities (ERU) located on the Windows 98 CD-ROM to back up the Registry. See the section "Backing Up Configuration Files" later in this chapter for more information.
PC software and the people who use it have become more sophisticated over the years. Applications interact with each other in ways they never did before, and the Windows operating system keeps increasing the features it provides to applications. The Windows 98 Registry grew over time in response to the increasing interaction between applications and between applications and the operating system.
Before Windows 3.1, there was no system Registry. SYSTEM.INI stored system configuration information and WIN.INI stored application configuration information. This led to the following major problems:
Windows 3.0 solved these problems to some extent by providing applications the capability to create and maintain their own INI files, which unfortunately created the following new problems:
The Windows 3.1 Registry was created to solve these problems, and its basic structure is similar to the Windows NT and Windows 98 Registries. It's a hierarchy similar to the file system: Registry keys are analogous to directories, Registry values are analogous to files, and Registry data is analogous to the information inside a file. Each key can contain other keys and a single value.
Registry keys are identified much like file directories are. For instance, there is a Network key inside the Enum key, which is inside the HKEY_LOCAL_MACHINE root key, which is in the Registry of My Computer. The path to the Network key is My Computer\HKEY_LOCAL_MACHINE\Enum\Network.
The Windows 3.1 Registry's main function was to provide a single place in which the system and applications could find shared information, such as DDE commands and OLE server locations.
Windows NT expanded the idea of the Registry, going a long way toward cleaning up the morass of INI, CONFIG.SYS, and AUTOEXEC.BAT files. NT's Registry contains all the information that used to be in the INI, CONFIG, and AUTOEXEC files. The NT Registry also contains Program Manager information that Windows 3.1 stored in GRP files. The NT Registry's hierarchical structure is more complex and robust than the Windows 3.1 Registry and provides backward compatibility via the HKEY_CLASSES_ROOT tree, described later in this chapter in the section "Registry Keys and Contents."
Windows 98's Registry is both more and less than the NT Registry. In fact, Microsoft says it's a completely different implementation that supports the same functions--if not all the same keys and features. Here are the three primary differences:
One of the necessarily unfortunate outcomes of creating Windows 98 is the awkward way in which Registry and INI files work together. Windows 98 represents a transition away from old-style initialization files and their problems to a better, more robust way of maintaining system configuration information. This section describes how the old and new methods work together.
If the Registry contains all configuration, initialization, and startup information, INI and startup AUTOEXEC.BAT and CONFIG.SYS files are no longer necessary, right? Well, true--technically. Windows 98 doesn't need those files, although it can use them if they're present. If you never install DOS, for instance, Windows 98 never needs startup files. It can access the Registry for all the information it needs about device drivers, the last network drive, and so on. The same goes for the INI files. If they don't exist, Windows 98 doesn't mind just searching the Registry for whatever information the INI files otherwise would contain, such as VxDs, mouse preferences, and so on.
Practically speaking, however, INI and startup files are going to be around for a while. Older 16-bit applications (many of which people will use for years to come) require WIN.INI, WINFILE.INI, and SYSTEM.INI. Many 16-bit applications create their own INI files, which Windows 98 cannot directly translate into Registry entries. Most users also probably will continue to want DOS installed on their Windows 98 systems, which requires AUTOEXEC.BAT and CONFIG.SYS files.
If you install Windows 98 over an existing Windows 3.1 system, the installation program copies information from CONTROL.INI, PROGMAN.INI, SYSTEM.INI, WIN.INI, and other INI files to the Registry. Later in this chapter a section describes the actual INI file entries that are copied to the Registry.
Some entries are not copied to the Registry so that the INI files can remain backward compatible with older 16-bit applications. In this case, Windows 98 needs the INI files so that those older applications can run properly. To manipulate all these entries, you can use graphical tools in Windows 98, such as Control Panel applets, to change the entries in the INI files without resorting to manual editing.
Some INI settings also are not copied to the Registry by the Windows 98 installation procedure and cannot be modified using graphical tools. Windows 98 needs these entries to run some applications properly, but you should never need to modify the entries directly.
Ideally, all applications are 32-bit applications, no one runs DOS because all Windows applications run perfectly, every Windows 98 installation is a clean installation rather than an upgrade, and you need never worry about any INI or startup files. Until that utopian day, however, anyone who maintains configuration information needs to keep the old configuration files in mind.
The Registry is a single data store existing across a number of files the system and applications can access and use to modify configuration information. The three file types that store all Registry information are SYSTEM.DAT, USER.DAT, and policy (POL) files. SYSTEM.DAT is the only file of that name on each machine. USER.DAT occurs at least once on each machine and possibly more. A given machine can have zero, one, or more policy files.
Each time Windows 98 shuts down, it makes a copy of SYSTEM.DAT and USER.DAT in the Windows directory and all other USER.DAT files in other directories. These files are named SYSTEM.DA0 and USER.DA0. You can rename and reuse them if the Registry becomes corrupted. DAT files are marked as hidden files. You must display the hidden files in the Windows directory to see them. The next three sections describe these files.
When you boot Windows 98, it locates and accesses SYSTEM.DAT before any other part of the Registry. SYSTEM.DAT belongs in the main Windows 98 directory (C:\Windows on most systems) and contains all hardware- specific configuration information for the machine on which it resides.
You generally find USER.DAT files in the main Windows 98 directory. Windows 98 reads USER.DAT right after it reads SYSTEM.DAT. Other USER.DAT files can reside in the individual profile directories for each user who can log onto a machine. John Doe's USER.DAT, for example, might be in directory C:\Windows\Profiles\Jdoe. These DAT files contain user-specific information, such as passwords and individual application preferences.
The USER.DAT files in the profile directories load after the USER.DAT file in the Windows directory. If there are conflicts between these two files, the conflicting information in USER.DAT from the profile directives takes precedence.
The main USER.DAT file in the Windows directory contains system configuration information, such as Control Panel settings, application settings, Start menu (Program Manager) groups, desktop files, and locations of postoffice files (such as the personal address book and personal information storage files). The USER.DAT in the profile directories contains much the same information and takes precedence over information in the USER.DAT from the Windows directory. Hence, entirely different configurations can exist for multiple people on a single machine, including e-mail, Control Panel settings, and desktop file locations.
WARNING: The Registry remembers the onscreen location of desktop files for each user but keeps only one list of the files (or link files) on the desktop. If one user has a copy of MYFILE.LNK in the upper-right corner of the desktop and another user has the same file in the middle of the screen, deleting the file from either account removes it from both. This is a limitation of Windows 98 security. If anybody deletes a file, it's gone (into the Recycle Bin, at least). Windows 98 doesn't distinguish between who owns the file and who deletes it.
CONFIG.POL files are system policy files that override some information in the Registry. These files are used to force machines on a network to have the same configuration or to enable roving users to keep their same configuration when they log onto different machines on the network.
CONFIG.POL files are created and modified using the System Policy Editor, which comes with the Windows 98 Resource Kit. Use for the System Policy Editor and how to maintain policy files is described in the Resource Kit documentation.
The Registry contains three types of objects: keys, values, and data. The Registry hierarchy that uses this information resembles the file system with which most people are familiar. Keys are analogous to directories, values are analogous to files, and data is analogous to the information within a file.
Keys can contain one or more other keys and values. Each key and value must have a unique name within a key or subkey. As with the Windows 98 file system, keys are case aware but not case sensitive. A key name can contain any visible characters, including spaces and symbols, except for the backslash (\), because it delimits hierarchy paths in the Registry, such as paths in the file system.
Keys and subkeys contain at least one value with the special name (Default) for backward compatibility with the Windows 3.1 Registry and old 16-bit applications. The (Default) value might not contain any data, in which case the data field reads (value not set).
Figure 12.1 uses the Registry Editor to display nested Registry keys in the left pane, the written Registry path in the status bar at the bottom of the window, and the default, unused value for the key in the right pane.
FIGURE 12.1 The Registry Editor uses two panes to display the structure and content of the Registry. Note the path in the status bar.
The root key HKEY_CLASSES_ROOT and the subkey HKEY LOCAL MACHINE\ SOFTWARE\Classes contain a superset of the information in the Windows 3.1 Registry (they actually point to the same Registry data). Because the Windows 3.1 Registry can have only one value per key, the Windows 98 default value is the value that would be in the Windows 3.1 Registry for that key, so 16-bit applications look to the default value to find DDE and OLE information. Default values are rarely used in other root keys.
WARNING: Don't modify the default value under these keys unless you know exactly what you're doing. These values are placed there by software applications and the operating system, usually when they are first installed. If this information becomes corrupted, the only way to fix it is to reinstall the application or operating system or recover old Registry files.
The Registry can represent three types of data: strings, binary information, and double word (DWORD) values. The default value is always a string, although it appears as (value not set) until it contains data. If data is removed from the default value (by using the Registry Editor, for instance), the data appears as a null string (") rather than (value not set). In other words, (value not set) only appears in the Registry for values that have never had data entered into them.
Viewing and editing Registry values are explained in the section "Using the Registry Editor" later in this chapter.
Registry data is always contained in a value. A piece of data cannot be lar-ger than 64 KB.
This section describes a number of the important keys in the Registry. The Registry contains thousands of keys whose values can change at any time. Applications also can add and change keys and values whenever and wherever they want, but Microsoft has delineated standards for when and how applications should modify the Registry. As a result, it's impossible to compile a complete list of keys and their possible values. This section describes all the root keys, some important subkeys, and some keys that serve as examples of Registry usage. The discussion centers around how keys are set up and affect the Registry but does not describe how to set key values for system or application functions, such as DDE and shell extensions. The best way to view this information is through the Registry Editor.
The HKEY_CLASSES_ROOT provides backward compatibility with Windows 3.1 for OLE and DDE support. It also contains OLE and DDE information specific to Windows 98, such as shell extension keys and values. In reality, this key acts as a pointer to HKEY_LOCAL_MACHINE\SOFTWARE\Classes. The information underneath these keys is the same. Microsoft made HKEY_CLASSES_ROOT a pointer to HKEY_LOCAL_MACHINE\SOFTWARE\Classes because it makes this common information easier for applications and the operating system to access, and it makes compatibility with Windows 3.1 easier.
All the subkeys under HKEY_CLASSES_ROOT refer to document types associated with the applications installed on the system (except for the * subkey, which is associated with all application document types). The file extension subkeys point to document description subkeys, which in turn point to class ID subkeys. These trails of keys contain DDE, OLE, shell, and shell extension information, as well as the file locations of the OLE servers that support the document type.
NOTE: This section uses font files for a simple example of registering document types. Other document types vary in complexity, depending on the supporting application.
To locate the DDE, OLE, and shell information about a document, first find the document extension subkey under HKEY_CLASSES_ROOT--.fon, for in-stance. The default value for this key is fonfile. Locate the fonfile subkey under HKEY_CLASSES_ROOT. The default value of this key, Font file, is the description of the document type. In the case of this document type, there is only one OLE function, which is also a shell extension. Under the shellex subkey is the IconHandler subkey. The default value shows the OLE class ID (CLSID). Under the HKEY_CLASSES_ROOT\CLSID subkey, locate the subkey with the same number as the font file icon handler subkey. The default value describes which type of OLE handler the subkey is. The InProcServer32 subkey has a default value, which is the location of the file that contains the icon handler.
The first subkey of HKEY_CLASSES_ROOT, *, is a wild-card key. The Windows 98 shell extensions use this special key. Shell extensions are OLE servers (usually in DLL files) that provide extra user interface functionality to Windows 98. The wild-card key specifies shell extensions that apply to all applications--not just a single application. This means, for instance, that you can add information to the Context menus of all icons, or you can add property pages to all property sheets shown in the shell.
Windows 98 begins searching for information associated with a document type by looking for the key name that matches the file extension. The main purpose of these keys is to indicate another key in HKEY_CLASSES_ROOT that describes the document type in greater detail. The default value of the key is the name of the document definition subkey.
The subkeys of the document definition subkey provide most of the OLE, DDE, and shell extension attributes of the document type. The default value is a text string that gives a one-line description of the document type.
Some document definition subkeys point to a CLSID subkey, for which the default value is a long string of numbers. These are OLE class identifiers, which match the CLSID subkeys under the HKEY_CLASSES_ROOT\CLSID key.
All subkeys underneath HKEY_CLASSES_ROOT\CLSID are OLE class identifiers. The class identifier for a particular document type is guaranteed to be unique across all PCs in the world. The default value of the key is a description of the OLE class. The location of the file that contains the OLE implementation for that class is usually located in the InProcServer32 subkey (for a DLL) or LocalServer32 (for an EXE). If the document is supported by older 16-bit OLE applications, the location might also be in InProcServer or LocalServer subkeys.
HKEY_CURRENT_USER is another Registry key that points to another key--to the subkey of HKEY_USERS for the user currently logged onto the PC. This user profile information ensures that Windows 98, the individual application setup, and the user interface all operate identically on whichever machine the user works, as long as the user's profile is available on every PC on which the user works.
Figure 12.2 shows the Registry Editor with the HKEY_CURRENT_USER and HKEY_USERS\jruehlin keys open. HKEY_CURRENT_USER is the same as HKEY_USERS\jruehlin (it's actually a pointer to KEY_USERS\jruehlin) because jruehlin is the logon name of the current user.
FIGURE 12.2 Image of HKEY_ CURRENT_USER and HKEY_USERS\ username.
Most applications should place Registry information for this key under the HKEY_CURRENT_USER\Software and HKEY_CURRENT_USER\.Default\Software subkeys. The intent is for these keys to contain information formerly placed in the INI files of specific applications.
When identical information exists between HKEY_CURRENT_USER and HKEY_LOCAL_MACHINE, the information in HKEY_CURRENT_USER takes precedence.
Table 12.1 explains the subkeys for HKEY_CURRENT_USER.
TABLE 12.1 Subkeys for HKEY_CURRENT_USER
| Subkey | Contents |
| AppEvents | Subkeys that contain paths to current and past sound files that play when a system event occurs (such as a system beep). |
| Control Panel | Subkeys that contain information set using the Control Panel. Much of this information was stored in WIN.INI and CONTROL.INI under Windows 3.1. |
| Keyboard Layouts | Current keyboard layout set using the Keyboard icon in the Control Panel. |
| Network | Subkeys that define the current state of the network. |
| RunMRU | A list of the most-recently run applications. |
| Software | A pointer to HKEY_LOCAL_MACHINE\Software. The subkeys describe settings and options for the current user's installed software. This application-specific information was previously stored in WIN.INI or application-generated INI files under Windows 3.1. |
| StreamMRU | Values pointing to recently used documents. |
Applications will add more subkeys when installed to keep track of information specific to those applications.
HKEY_LOCAL_MACHINE stores the following non-user-specific hardware and software configuration information for the local PC, which applies regardless of who logs onto the system:
FIGURE 12.3 Picture of 0001 subkey and IDConfigDB subkey.
NOTE: The Network subkey enumerates network bindings, protocols, and services. It does not enumerate network adapters.
FIGURE 12.4 The HKEY_LOCAL_ MACHINE\Software\ Microsoft subkey.
The HKEY_USERS root key contains all user profiles. As described earlier, the HKEY_CURRENT_USER root key points to the HKEY_USER subkey that holds the profile information for the current user. Information in individual user profile subkeys is described under HKEY_CURRENT_USER.
HKEY_USERS always contains at least the .Default subkey. .Default is used to create a user profile for a user who logs onto the system without one. This might be someone whom the system administrator adds to the system or who signs onto the PC via a domain controller.
This key points to the HKEY_LOCAL_MACHINE\Config subkey. It makes accessing information within that key easier for applications.
This key holds information that must be stored in RAM at all times. Normally information in the Registry is flushed at regular intervals or by applications that write information to the Registry. During a Registry flush the information is written to the SYSTEM.DAT and USER.DAT files. However, some information must always be available immediately. This is the information pointed to by HKEY_DYN_DATA.
The Config Manager subkey is also referred to as the hardware tree. It is a record in RAM of the current hardware configuration. This information can be updated and changed at any time so that Plug and Play devices can be supported. This information is created during system startup and is updated whenever the system configuration changes.
This subkey maintains performance information for network components. Performance statistics can be viewed through the SYSMON application, which will probably be either an optionally installed component of Windows 98 or part of the Windows 98 Resource Kit.
The Windows 98 Registry Editor (REGEDIT.EXE), located in the Windows directory, provides a fairly straightforward means for directly editing the Registry, although using a software tool or application, such as a Control Panel applet, offers a safer and often more convenient means. Using indirect editing tools greatly reduces the chances of inadvertently corrupting the Registry.
The Registry Editor displays a single, two-paned window. The left pane is a hierarchical list of keys and subkeys, and the right pane is a list of value names and the data for the values.
To expand a key, click on the plus sign to the left of the folder. If you don't see a +, you can't expand the key because it doesn't have any subkeys. You can expand or shrink both frames by choosing View|Split or by using the mouse to move the splitter bar in the middle.
Table 12.2 lists the Registry Editor's shortcut keys for navigation and viewing.
TABLE 12.2 Registry Editor Navigation and Viewing Shortcut Keys
| Key | Action |
| Plus sign | Expand the selected key one level if it has subkeys. |
| Minus sign | Collapse the selected key one level. |
| Up arrow | Move up to the next key. |
| Down arrow | Move down to the next key. |
| Left arrow | Collapse the selected key if it's open; otherwise move up to the next key. |
| Right arrow | Expand the selected key if it has subkeys; otherwise move down to the next key. |
| Tab | Move to the other pane. |
TIP: Clicking on a key or value with the right mouse button opens a Context menu that contains all its allowable operations, including renaming, deleting, modifying, and creating new objects.
To locate information in the Registry Editor, choose Edit | Find (Ctrl+F) or Edit | Find Next (F3). You can search for keys, values, data in values, or any combination of these. Search values can be text or numbers.
When Registry information is located, the item that matches the search criteria is highlighted. Any nested subkeys are opened in the left pane so that the information can be properly displayed.
Unfortunately, when a value or data item is located, it's often difficult to tell which key it belongs to. The Find operation displays an open folder in the left pane for the key associated with the value or data in the right pane; but there can be many folders showing, and it's difficult to pick out the one that looks "open."
When value or data items are located, the open folder is usually at the bottom of the left pane, as shown in Figure 12.5.
FIGURE 12.5 Image of value located and open folder at the bottom.
Import and Export options store and retrieve Registry information. They provide a good way to back up Registry keys and subkeys before you make significant changes to them. They also provide a convenient way to send information from a Registry on one machine to another.
Registry information is imported from and exported to Reg files, which are editable text files. To export a key and all its subkeys, values, and data, select the key and choose Registry|Export Registry File. To import Registry information, choose Registry|Import Registry File; then select the REG file to import from the File Open dialog box.
TIP: You can easily import the information in a REG file into the Registry by double-clicking on the REG file icon.
To print Registry information, select the key you want to print and choose Registry|Print. The Printer Options dialog box appears. From this dialog box you can choose to print all information contained within the selected key or all information in the Registry, or you can type a different key name and print all information contained in it.
When you prepare to print the Registry, think about which part you want to print. You should not print the entire Registry because of its length. On just a normal Windows 98 installation, for instance, the Registry can be over 500 laser-printed pages long. Instead of printing the entire Registry, select a Registry branch to print.
TIP: A quick way to access many of the features of the Registry Editor is to select a key or value with the right mouse button. A Context menu appears that offers features available for the selected item.
It's a good idea to periodically make backups of your system's configuration files. By backing up the configuration files, you make it possible to restore a system's configuration if it becomes corrupted. It's a good idea to back up your configuration files on a regular basis, and you should always back them up prior to installing any new software. If the system becomes unstable after the installation, you simply remove the new application and restore the configuration files, and your system should be right back to normal.
In general, you should back up your Registry and other configuration files prior to installing or removing any software. In the case of removing software, back up the configuration files again after you remove the software and verify that the system is working properly.
Windows 98 includes two tools for backing up configuration files. These two utilities are explained in the following sections.
The first of Windows 98's configuration backup utilities, called the Emergency Recovery Utility (ERU), is designed to back up not only the Registry but also several other configuration files. These files include the following:
ERU is a Windows application (see Figure 12.6) that enables you to select the files to be backed up as well as the location for the backup. ERU functions essentially as a wizard, stepping you through the process of selecting the files and the backup location.
FIGURE 12.6 Use ERU to back up your system's configuration files.
There are two primary considerations when using ERU--which files to select and where to put them. By default, ERU will select all the files listed previously, which include the two files that make up the Windows 98 Registry (USER.DAT and SYSTEM.DAT). Generally you'll want to back up all of the files. If you are backing up the files to a floppy disk, however, you might need to select a subset of the files because the entire set might not fit on the disk. If this is the case, you can run ERU multiple times, selecting a different subset each time until you have all the files backed up onto a set of floppy disks. Alternately, you can back up the files to a folder on the hard disk.
TIP: You can create multiple backup sets by placing each backup set in a different folder. For example, you might create a folder called Backup, then create individual folders within it using the date of the backup as the folder name (or some other descriptor).
When you create a configuration backup set using ERU, ERU places not only the configuration files in the backup target folder but also places a command line program named ERD.EXE. The ERD.EXE program is the tool you use to restore the configuration files. If you need to restore your configuration files, boot the computer to a command prompt, change to the folder containing the configuration backup, and execute the ERD.EXE program. After the files are restored, reboot the computer and boot Windows 98 normally.
TIP: To boot Windows 98 to a command prompt, locate the file MSDOS.SYS in the root folder of your boot drive (typically drive C). Remove the Read-Only and Hidden attributes so you can edit the file. Open the file in Notepad or another text editor and add the setting BootMenu=1 to the [Options] section of the file. The next time you boot the computer, a boot menu will appear giving you several options, including the option to boot to a command prompt.
If you want to back up just the Registry, you can use another utility included with Windows 98 called Microsoft Configuration Backup (CFGBACK). This utility is located in the \Tools\Misc\Cfgback folder on the Windows 98 CD and, like ERU, is a Windows application (see Figure 12.7).
FIGURE 12.7 Use Configuration Backup to back up the Registry.
Although Configuration Backup will back up only the Registry, it enables you to back up as many as nine copies of the Registry. CFGBACK operates fully as a Windows program, enabling you to both back up and restore Registry files from within Windows.
Backing up and restoring Registry files with CFGBACK is simple and requires no explanation. Just follow the prompts the program provides.
This section describes some techniques to help you maintain and enhance your Registry.
You can maintain identical configuration information for numerous users across multiple machines. This enables those users to share the machines while keeping their familiar configuration settings such as desktop appearance and passwords.
To copy John Doe's configuration information from an old PC to a new one, perform the following steps:
You can run the Registry Editor (REGEDIT.EXE) from real mode if Windows 98 doesn't start. If the system is too corrupted to run, you also can run REGEDIT.EXE from a Windows 98 startup disk to diagnose the problem.
Table 12.3 contains command-line parameters for the Registry Editor.
TABLE 12.3 Registry Editor Command-Line Parameters
| Command | Description |
| regedit /e export.reg | Exports entire Registry to EXPORT.REG. |
| HKEY_USERS\.Default | Exports subkey HKEY_USERS\.Default and all its subkeys to EXPORT.REG. |
| regedit /i export.reg | Imports the file EXPORT.REG into the Registry. |
| regedit /c export.reg | Replaces entire Registry with EXPORT.REG. |
WARNING: When you use Regedit in real mode, do not import a Registry branch into the Registry using the /C switch. If you do, your complete Registry file will be overwritten with just the branch you specify. When you use the /C switch, make sure you specify a complete Registry filename.
Whenever Windows 98 boots successfully, SYSTEM.DAT and USER.DAT files copy during bootup to SYSTEM.DA0 and USER.DA0, which are always the last known good files and, consequently, files you can use to restore Registries that become terminally corrupted.
Many power users got intimate with the INI files found in Windows 3.x. Now that INI files are being replaced by Registry entries in Windows 98 applications, power users have had to find new ways to troubleshoot and customize their applications. Although the Windows 98 Registry offers many benefits to the user and system administrator, one of the problems with the Registry is that it is not always easy to find a setting to edit to make something work better.
For troubleshooting problems associated with hardware, many of the best solutions can be found by learning how to use the Device Manager and Control Panel (see Chapter 5, "Adding and Configuring Hardware," for information on using the Device Manager). The Device Manager and Control Panel let you see which resources are allocated for each hardware device, which device drivers are loaded, and which device drivers let you change these options in a much more intuitive interface than Windows 3.x enabled you to. Sometimes, however, you need to obtain information to edit the Registry to make a device work better.
Likewise, you can use the Control Panel to modify some software problems you might be having. You might, for instance, have problems with system or application sounds that you can alter by using the Sounds icon in the Control Panel. Other times, however, you might have to use the Registry to make adjustments for an application or Windows 98 to run more smoothly. The following sections describe some specific troubleshooting problems and customization instructions that use Registry values.
Windows 98 is designed to boot into Windows even if something goes wrong, such as if a device is missing, the wrong device driver is installed, or the Registry was not properly updated during the last session. This latter problem sometimes occurs if you don't properly run the Windows 98 Shut Down program. Windows 98 Safe mode is designed to let you boot into Windows with a very basic Windows configuration so you can modify configuration settings to make Windows boot properly.
In practical experience, however, sometimes you boot your system and get an error that Windows has encountered a problem accessing your Registry. One solution is to run the real-mode REGEDIT application as described earlier in the section "Recovering from Corrupted or Unusable Registry Files." If that doesn't work and you've tried everything except reinstalling Windows 98 (which should be your last resort), use the following steps:
In many cases, the SYSTEM.DA0 file is not corrupted and should boot you into your last best boot.
If this does not work, use the following steps:
If Windows 98 does not start up properly, use the following steps to reinstall Windows 98 and re-create the Registry files:
NOTE: Back up any files on your system you do not want to lose. You might have to do this at the DOS command line.
cd \windows attrib -s -h -r system.1st ren system.1st system.old attrib -s -h -r system.dat ren system.dat system.ol1 attrib -s -h -r system.da0ren system.dao system.ol2
Sometimes the Registry values are not updated properly when you double-click on a file with a .REG extension. What might happen during these times is that Windows 98 mistakenly adds the values as new values instead of updating the old values. In the Microsoft Knowledge Base article Q136783, Microsoft attributes this problem in some cases to trailing spaces on one of the values. To correct this problem, simply edit the new value so it matches the old one, removing any trailing spaces from the values. You might need to reboot Windows 98 for the change to be noticed by your application.
If you receive the following error message, you know your Registry is damaged:
SMDErr (80000003): Registry access failed.
You might see this error when Windows 98 is attempting to detect one of your hardware devices. To correct it, use the following steps:
NOTE: If a message about missing data is displayed, don't worry. You can ignore it because you already know your Registry file is corrupted.
The following error message can occur if you are running an older version (such as a beta version) of the Remote Registry Service:
Error Starting Program: REGSERV.EXE Linked to Missing Export KERNEL32.DLL;Vxdcall3
To correct the problem, install a new version of the Remote Registry Service using the following steps:
Many users have encountered the annoying problem of Windows 98 looking for its source disks in only one place--specifically from the same source from which you installed Windows 98. If, however, you want Windows 98 to look to a different source from where you installed Windows 98, you need to modify the Registry. You might, for example, have installed Windows 98 from floppy disks and then obtained the Windows 98 Setup CD-ROMs. Or perhaps you have plenty of space on your hard disk and have placed the Windows 98 source files on the hard disk so you have access to them without the CD-ROM. Use the following steps to change the source path:
HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Setup
TIP: If you have Microsoft Plus! installed, you can change its source path by modifying the HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Plus!\Setup key. Change the SourcePath value and delete the file SETUP.TDF in your C:\PROGRAM FILE\PLUS!\SETUP folder in Explorer.
Windows 98 does an excellent job of saving all your settings when you exit Windows, as long as you use the proper shutdown procedure. But sometimes you might have a system on which you don't want settings to be saved, such as a computer you use for training or one you use for display purposes. In those situations, you don't want users changing a setting and then rebooting the system. Use the following steps to turn off the option of saving settings on exit:
HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\ Policies\Explorer2. Change the NoSaveSettings from 0x00000000 to 0x00000001.
The following items are now not saved when you exit Windows 98:
If you have a slow video card, you can increase the speed at which Windows displays onscreen objects by turning off the animation effects. The following steps show you how:
HKEY_CURRENT_USER\Control Panel\desktop\WindowMetrics.
If you ever inherit a system from someone at work and get tired of seeing that person's name appear on your system, you can change the system name and company name in Windows 98. Use the following steps:
HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion
You can change literally any aspect of Windows by directly manipulating the Registry. Generally, however, you should use the tools provided in Windows (such as the Control Panel) to modify the Registry. In addition, it's a good idea to make backups of your system Registry to use in the event that it becomes corrupt.
Despite your best maintenance efforts, your system may crash hard enough that a simple recovery becomes impossible. In that case, you have no alternative but to format (or replace) your hard drive and start from scratch. However, that doesn't mean you have to laboriously reinstall Windows 98 and your applications. With some advance planning, you can use the new System Recovery utility to both reinstall Windows 98 and return your hard drive to its pre-crash state.
System Recovery consists of three pieces:
PCRESTOR.BAT. After you format your hard drive, you boot from your startup disk and then run this batch file. PCRESTOR.BAT performs several chores, but its main task is to start the Windows 98 Setup program with various switches and parameters.
MSBATCH.INF. This is an information file that specifies a number of settings and parameters used by Setup. In particular, this file tells Setup to run the System Recover Wizard (see the following). When PCRESTOR.BAT starts Setup, it tells the program to use MSBATCH.INF.
System Recovery Wizard. After Windows 98 is reinstalled, this Wizard loads automatically to take you through the rest of the recovery process, including restoring the files from your system backup.
NOTE: HOW DOES IT WORK?
How is Setup able to run the System Recovery Wizard automatically? The key (literally!) can be found inside MSBATCH.INF, where you'll find the following settings:[RegistrySettings] HKLM,%KEY_RUN%,BatchReg1,,"%11%\srw.exe" [Strings] KEY_RUN="SOFTWARE\Microsoft\Windows\CurrentVersion\Run"
These settings modify the following Registry key:
HKEY_LOCAL_MACHINE\Software\Microsoft\Windows\CurrentVersion\Run
This key is used to specify programs that run automatically at startup. In this case, the program SRW.EXE--the System Recovery Wizard--is added to the key.
To use System Recovery successfully, you must assume your machine will crash one day and so make the necessary preparations. Specifically, you must follow these guidelines:
System Recovery is one of those tools that you hope you never use. However, if the day does come when your system needs to be recovered, you'll be glad to know that doing so takes just a few steps:
FIGURE 12.8 The System Recovery Wizard takes you through the process of restoring your system to its pre-crash state.
As you've seen, System Recovery is quite rigid about a few things. For example, it will only reinstall Windows 98 into C:\WINDOWS, and it will only install from a hard disk. System Recovery would be a much more useful tool if it enabled you to overcome these and other limitations. However, although Microsoft does not recommend or support customized System Recovery procedures, it is possible to improve upon the basic process.
The reason System Recovery is so inflexible is that most of its options are set in advance within the PCRESTOR.BAT and MSBATCH.INF files. These are just text files, however, and text files can be edited, albeit with a modicum of caution and a nod to common sense. Here are a few techniques you can try:
The installation directory is governed by the InstallDir setting within the [Setup] section of MSBATCH.INF. If you prefer to install Windows 98 on drive D, for example, you must modify this setting as follows:
InstallDir="D:\Windows"
If you're on a network, Setup prompts you to log on to the network during the reinstall. However, System Recovery uses a generic user name of "System Recovery" and a generic workgroup name of "WORKGROUP," which is also used as the logon domain. System Recovery also sets up a generic computer name of "Windows 98 User." You can customize all four values using the following settings in MSBATCH.INF (note that these values assume a Microsoft Networking login):
[NameAndOrg] Name="System Recovery" [Network] ComputerName="Windows 98 User" Workgroup="WORKGROUP" [VREDIR] LogonDomain="WORKGROUP"
The reason you must reinstall Windows from a hard drive is that PCRESTOR.BAT launches Setup from a WIN98 directory that's in the same drive as PCRESTOR.BAT:
cd\ cd win98 setup.exe c:\restore\msbatch.inf /is /id /iq /im /id /ie /IW
To start Setup from another location, you must modify the first two lines. For example, if you want to run Setup from the Windows 98 CD-ROM in drive D, modify the first two lines as follows:
d: cd\win98
© Copyright, Macmillan Computer Publishing. All rights reserved.