No need to feel intimidated around the Registry. Here's a brief tour -- and your chance to modify the Registry safely.
The Windows 2000 Registry
No need to feel intimidated around the Registry. Here's a brief tour -- and your chance to modify the Registry safely.
No, we're not talking about buying gifts for Spring weddings.
This month's topic: the do-not-try-at-home, all warranties-are-void,
don't-rip-the-tag-of-this-pillow-under- penalty-of-law
Windows 2000 Registry! Are you tired of being pushed around
by Microsoft and Win2K gurus when it comes to learning
about the Registry? This month I'm going to build your
confidence on the topic. By the end of the column, not
only will you have defined and navigated through the Registry,
you'll even have added your own Registry key.
What the Registry Is
Myths abound in the ranks of the high tech that the Registry
is some evil monster lurking behind your colorful desktop,
waiting to decertify you at the next mouse click. The
Registry is simply an operating system database that contains
configuration settings. For old timers, the Registry replaces
the old *.ini files from the Windows 3.x days. Those of
you with an OS/2 background will recognize the Registry
concept. It's similar, leading me to ask if the Registry
is one of the surviving offspring from that messy Microsoft/IBM
divorce, which took place in the early '90s.
Specifically, the Registry stores:
- User profiles
- Application installation settings and document-type
file associations
- Hardware profiles
- Port information
The Registry used a directory hierarchy before it became
fashionable. Its basic tree structure -- with keys, subkeys,
hive, and values -- hasn't changed since Window NT days.
(Somewhere in here lurks a Win2K MCSE certification mindbender
question, eh?)
Back It Up First!
Before proceeding, it's critical to have a bona fide
Registry backup. You never know when you'll need to roll
back to a previous copy of the Registry. Needless to say,
the Registry is taken seriously in Win2K. The developers
have paid plenty of attention to Registry backup and recoverability.
Not only does the built-in Win2K Backup program have the
ability to back up the Registry, but so does every major
third-party backup program on the market. In Win2K this
happens when you back up System State data and create
an Emergency Repair Disk (ERD). You may also back up the
Registry by backing up the \%system_root%\repair folder
(in English, that's typically C:\WINNT\Repair).
The term "System State data" is new in
Windows 2000. It refers to the following components:
- The Registry (found in both Windows 2000 Professional
and Server).
- COM+ Class Registration database (this is developer
stuff -- found in both Windows 2000 Professional and
Server).
- Boot files (found in both Windows 2000 Professional
and Server).
- Certificate Services database (part of Windows 2000
Server only).
- Active Directory (found in Windows 2000 Server only).
- SYSVOL directory (a shared directory that stores
the server copy of the domain's public files, which
are replicated among all domain controllers in the domain).
- Cluster service information (found in Windows 2000
Advanced Server, this software component controls all
aspects of server cluster operations and manages the
cluster database).
To back up the Registry as part of the System State data
backup, follow these steps.
- Click the Start button on the desktop.
- Select Program | Accessories program group.
- Launch Backup from the System Tools program group
(found in the Accessories program group)
- The Backup application appears as seen in Figure
1. Click the Backup Wizard button.
|
Figure 1. The Windows 2000 Backup
application directs you in backing up the Registry,
a first critical step. |
- The Backup Wizard launches. Click Next.
- On the What to Back Up screen, select the "Only
back up the System State data" radio button, as
seen in Figure 2.
|
Figure 2. Selecting the System
State data radio button will back up the Registry
as well as other critical Windows 2000 files. |
- Click Next. The "Where to Store the Backup"
screen appears. You would typically select your tape
drive as the destination, but you can select another
hard disk, Jaz drive, etc. Make your selection and click
Next.
- The Completing the Backup Wizard screen appears.
Click Finish to start the backup.
Tip: When I performed
these steps on a Dell PowerEdge 1300 server in my workshop,
the System State data backup exceeded 305M -- which clearly
won't fit on a single 3.5-inch floppy! Select your backup
destination wisely.
- You'll receive a backup complete notice similar to
Figure 3.
|
Figure 3. The backup completion
notice indicates the backup job has been completed. |
Tip: You can also make
Registry backup by exporting the Registry via the Registry
Editor (discussed later in the column).
The Best Time to Work with the Registry,
Typically
Whew! Now that you have a Registry backup (which, by
the way, is the first step undertaken when you launch
a significant support incident with Microsoft technical
support), you can think about when you would actually
need to perform surgery on the Registry. Such surgery
certainly isn't performed when you install a well-behaved
application. Both you and I look to the software developers
to make Registry modifications in the background. But
there are some software applications that aren't well
behaved. For example, accounting applications installed
on a Windows 2000 Server machine that uses the Btrieve
database (instead of Microsoft SQL Server) require you
to make entries to disable opportunistic locking (a subject
beyond the scope of this column).
You're most likely to work with and learn about the Registry
when you're on the phone with Microsoft technical support.
Those technical wizards will have you perform feats of
magic. You'll see Registry entries not documented in the
MCSE certification courses nor Microsoft TechNet. In other
words, you'll really learn the Registry when you have
to.
You Already Modified the Registry
When you install Windows 2000 applications, you'll also
modify the Registry. Modifying settings in Control Panel
is another time you modify it. Adding new components such
as hardware devices is a third way. In many cases the
modifications are dynamic and don't require any further
action on your part -- not even a reboot of your computer!
Building Confidence Under the Hood
Got that backup made? Now let's dabble. At the command
line in Windows 2000 type:
regedit
This launches the Registry Editor. The result should
look similar to Figure 4.
|
Figure 4. Meet the Registry Editor. |
The Registry, as displayed in the Registry Editor, is
comprised of the following HKEYs:
- HKEY_CLASSES_ROOT. Contains file association
information.
- HKEY_CURRENT_USER. Contains profile information
for the currently logged-on user.
- HKEY_LOCAL_MACHINE. This is the critical part
of the Registry where you're likely to make modifications.
- HKEY_USERS. Contains profile information for
all users created on the system.
- HKEY_CURRENT_CONFIG. This actually repeats
some information presented in HKEY_LOCAL_MACHINE, such
as the CurrentControlSet.
Without going too much deeper, the Registry is an advanced
area of study. Now that you know how to get there, let's
end with two fun exercises. First, you'll create a key
in the Registry just to say you've done it! Then we'll
finish by determining what settings are the current settings
being used on your system.
To create a Registry key:
- Type regedit at the command line to launch the Registry
Editor.
- Expand the HKEY_LOCAL_MACHINE folder in the left
pane.
- Expand the SYSTEM folder in the left pane.
- Expand the CurrentControlSet folder in the left pane.
- Expand the Services folder in the left pane.
- Right-click on the Services folder in the left pane
and select New | Key from the secondary menu.
- Name the key "MicrosoftCertifiedProfessionalMagazine"
and press Enter. Notice this new key appears at the
bottom of the Services list in the left pane.
- Highlight the MicrosoftCertifiedProfessionalMagazine
key you just created.
- Right click in the right pane.
- Select New | String Value from the secondary menu.
- Name the New Value #1 to read "Editor".
Press Enter.
- Double-click the Editor value to display the Edit
String dialog box. In the Value data field type Linda
Briggs. Click OK. Your screen should look similar to
Figure 5.
|
Figure 5. You've now created
a key in the Registry! Notice the key name of MicrosoftCertifiedProfessionalMagazine
in the left pane and the string value Editor and data
Linda Briggs in the right pane. |
Tip: Notice that you
didn't have to perform any type of file save in the above
exercise for the changes to occur. That's because the
Registry is dynamically updated.
Care to guess why you can complete the exercise without
harming the Registry? Because you've created a Registry
entry that isn't used by anything in Windows 2000.
I end the column this month with an under-the-hood look
at how you can tell what source of information is being
used by Windows 2000 to create the CurrentControlSet key
(that is, what copy of the configurations is being used).
Why show you this? Because when you work with Microsoft
technical support, this is one item they'll have you check.
Go to the following location:
HKEY_LOCAL_MACHINE\SYSTEM\Select
|
Figure 6. How to interpret configuration
information in the Registry. |
Now look in the left pane at the Current entry. What's
the Data value? As you can see in Figure 6, it's "1".
That means the configuration information stored in the
ControlSet001 key is being used as the CurrentControlSet
by Windows 2000. Had enough? Good! See you next month.