mainarticles   mainarticles
mainarticles
mainarticles   mainarticles
mainarticles
mainarticles

Home | Computers


Preparing to edit the registry

By: lowster11
 










The registry is the database of system settings that Microsoft Windows refers to as it loads and as it operates. Why edit the registry at all? Most ordinary end-users have no occasion to do so. The changes they wish to make to the system's functionality can be made through dialog box interfaces. Still, there are some useful tweaks that can be made only by manually editing the registry.
Someone somewhere has probably created a dialog box interface for changing nearly every setting in the entire registry, but who has the time and money to explore them all? In most cases it's more efficient to simply bite the bullet and do the manual edit.
Some people are all gloom-and-doom, and will try to make you believe that merely opening the registry will make your computer self-destruct. That's not true, of course, any more than opening up the hood of your car will make your car stop working. The possibility for destruction is definitely there if you make extensively wrong changes -- either out of curiosity or ignorance -- but knowledgeable people are usually able to tinker "under the hood" without problems.
Here are some basic safety rules for registry editing:

  • Back up the registry before making any changes. System Restore works well for this; you can also use the Backup command in the Registry Editor.
  • Make sure any critical data files and settings are backed up, such asyour e-mail address book, your Web favorites, and your documents.
  • Know how to restore a registry backup. Practice to make sure you understand how.
  • Do not change, add, or delete anything unless you're absolutely sure you understand what you're doing and why.
  • Make notes of settings you change -- on paper, not just on an electronic file on the PC. That way if you disable the PC entirely you'll still have your notes available.
  • Until you're experienced, make only one change at a time. Then reboot and make sure everything is okay before making any other changes.
  • Don't alter the registry on your main work computer. Reserve your experiments for a computer that's not critical to your livelihood or happiness.

What's the worst that could happen?


Bottom line, worst case, what are you really looking at here? Well, the worst case would be that Windows won't start at all, even in Safe Mode. In that case you, would need to reinstall Windows from the Setup CD. The Repair feature will probably not work because it attempts to preserve your registry settings as much as possible, and that's exactly what you don't want in this case; you'll need to do a clean reinstall.
Not everyone has a Windows CD, though. If your PC came with Microsoft Windows XP preinstalled, you might have a regular Windows CD, or you might have some special recovery CD that does not contain a full version of Windows in an installable package. Instead, it might contain a disk image of Windows XP, plus all the applications that originally came with your PC, and you would need to reimage your hard disk to get back to normal.
If you have to reimage your hard disk, you lose all your data and installed applications.

Preparing for the worst


Things happen, and being prepared for every inevitability helps put your mind to rest. HP's Care Pack services help you prepare for the worst case scenarios--but more importantly, they help you you recover from them.















 Opening the Registry Editor   

The Registry Editor is accessible via the Run command on the Start menu or by clicking Start > Run, typing regedit, and clicking OK.
In earlier versions of Windows, there was an alternative Registry Editor called regedt32 that opened a slightly different view of the registry. It no longer exists as of Windows XP. You can still use the regedt32 command from the Run prompt, but it opens regedit.
Because you'll be using the Registry Editor a lot in this course, you might want to place a shortcut for it on the desktop. To do this, locate it in the C:\Windows folder and Alt+drag it to the desktop.

Understanding the Registry Editor window


The Registry Editor is a typical application window in many respects. It has a menu bar and a status bar. If you want to, you can explore the Help file by selecting Help > Help Topics.
The Edit menu in the Registry Editor has a Permissions command. Do not experiment with it; use it only to perform specific edits as directed by a reputable source. The worst messes someone can get into involve modifying permissions in the registry.
The Registry Editor window is divided into two panes. On the left is a tree structure, much like the file system tree on a disk drive. On the right is a pane that contains the settings for whatever is selected on the tree.
The sections at the left can be collapsed or expanded. The Registry Editor opens in whatever state it was previously used in, so you might already have some areas expanded. For now, collapse everything, so it looks like Figure 3-1.
Figure 3-1: The Registry Editor with all categories collapsed.
Figure 3-1: The Registry Editor with all categories collapsed.















 Browsing the categories   

Each category holds a certain type of information. It's not critical that you remember which category holds what data, because the edits you'll be performing will always tell you exactly where the value to be modified is located. However, you might find it interesting to know:

  • HKEY_CLASSES_ROOT (HKCR): Contains information for OLE and drag-and-drop and file associations. There's not much here to change that can't be more easily and safely changed through the Windows user interface, so leave this one alone.
  • HKEY_CURRENT_USER (HKCU): Contains the settings for the user who's currently logged in. The values here change to a entirely different set if you log off and then log on as someone else. Changes you make here affect only the current user's settings.
  • HKEY_LOCAL_MACHINE (HKLM): This is where you'll make most of your edits. It contains the settings for installed software available to all users, including most of the Windows XP interface itself.
  • HKEY_USERS (HKU): Similar to HKCU except it contains information for all users, not just the current one. The values from HKU get shifted into HKCU when someone else logs in. Each user is identified by a SID (security identifier) number, so it's not obvious which user is which. Leave these values alone. If you want to modify a user's settings, log in as that user and edit HKCU.
  • HKEY_CURRENT_CONFIG (HKCC): Similar to HKLM except it applies only to the current hardware profile. Most people don't use multiple hardware profiles so the differentiation is moot. Leave this one alone.

To browse a category, click the plus sign next to it. For example, try clicking the plus sign next to HKEY_CURRENT_USER. You'll see more folders, some of them with their own plus signs. Click one of them, and keep clicking and expanding until you get to the bottom rung. Then try collapsing them all again. Get familiar with this browsing activity, because you'll be doing a lot of it. Don't worry for the moment about the content in the right-hand pane.















 Finding information in the registry   

When you're looking for something specific in the registry but you don't know exactly where it's stored, use the Find feature.
For example, suppose you're cleaning your PC to give to a friend, and you want to change the name of the registered owner from yourself to the new person. If you happen to remember the location within the registry where this is stored, you could browse to it directly. But if you've forgotten, you could use Find to locate all instances of your name, and then figure out which is the correct one to change.
To use Find, select My Computer at the top of the folder tree at the left. If you don't, the Registry Editor perform the Find only at the selected level and its subordinate folders.
Select Edit > Find, and then in the Find what text area of dialog box, shown in Figure 3-2, enter the text to find and click OK.
Figure 3-2: Use Find to locate certain text strings in the registry.
Figure 3-2: Use Find to locate certain text strings in the registry.

After a moment or so of searching, the registry's view jumps to the first instance. For example, in Figure 3-3, a search for the PC owner's name, Faithe Wempen, and Find has located it.
Figure 3-3: Find has located the first instance of the text.
Figure 3-3: Find has located the first instance of the text.

»Enlarge image
You won't be making any registry changes in this lesson, but if you were going to make changes in the scenario described earlier (changing the ownership of the PC), you would leave this particular instance alone in Figure 3-3 because it's referring to a file path. It's not an internal setting, such as the registered owner's name. So continue the search by pressing F3 or selecting Edit > Find Next. Keep going until you find one for changing the registered owner, as in Figure 3-4.
Figure 3-4: The registration information for the PC.
Figure 3-4: The registration information for the PC.

»Enlarge image
The registry might contain multiple keys with your name as the value, depending on which other software you have installed. How do you know which is the right one? The best way to be confident about your edits is to consult a reputable online resource. For example, take a look at Annoyances.org for the answer to this particular scenario. Making uninformed guesses when editing the registry is the quickest path to a major headache.
The entire Annoyances.org Web site is a great source of information. Especially take a look at the Customizing Windows section.


















 Backing up the registry   

Before you make any changes to the registry, back it up. This is very important; it could mean the difference between a five-minute recovery from an error and a four-hour recovery.
The simplest way to back up the registry is to use System Restore to create a restore point. Select Start > All Programs > Accessories > System Tools > System Restore, and then create a restore point by following the prompts, as shown in Figure 3-5.
Figure 3-5: Back up the registry using System Restore.
Figure 3-5: Back up the registry using System Restore.

»Enlarge image
An alternative is to export the entire registry using the Registry Editor itself. To do this, click My Computer at the top of the folder tree in the Registry Editor window, and then select File > Export. In the Export Registry File dialog box, select a location and a file name. (RegBackup.reg would be a good name, for example.)

Restoring a registry backup


If you created a restore point with System Restore, simply go through the System Restore utility to restore your system to the earlier point.
If you exported the registry, click My Computer at the top of the folder tree in the Registry Editor and then select File > Import and select the backup file to be re-imported.

Backing up your data


Back up your data while you're backing up your registry. HP's OpenView software makes it easy for you to manage your backup and recovery across your storage products and media.














 Loading the last known good configuration   

Both of the registry restoration techniques described in the previous section assume that you can boot Windows -- at least in Safe mode.
If you mess up your system so thoroughly that it will not boot at all, here's a method that might help -- but only if you use it immediately.
If Windows fails to start, the next time you attempt to start a menu an error message will appear indicating that Windows did not start normally the last time, and offering several restart options. One of these is Last Known Good Configuration. This restores an automatically-created backup from the last time the PC booted correctly. Selecting that can set things right again.
However, this fix has a major limitation: every time Windows starts successfully, it overwrites that backup with the current registry version. So if you've started Windows successfully since you made the changes, your original registry backup doesn't exist anymore and the Last Known Good Configuration feature won't help you.

How registry edits are saved


Registry edits made with the Registry Editor are saved immediately; there's no Save feature per se. Therefore, if you make an edit that you immediately know was wrong, you can't just exit without saving.
A reliable way to revert back after a bad edit is by loading the last-known good configuration, as described in the preceding section. You can force the boot menu to appear at startup by pressing F8 as the PC is booting up. The exact moment to press F8 can be difficult to gauge; one way to make sure you hit it is to repeatedly press and release F8 as soon as the boot process begins. (You can't just hold down F8 or you'll get a Key Stuck message.) If you mistime pressing F8 and Windows starts normally, the automatic backup of the registry is overwritten and Last Known Good Configuration won't help you. At that point, you would need to use System Restore to revert to an earlier version of the registry, or use Import within the Registry Editor.

Article Source: Main Articles

HPHome Computer Support

This article may be reproduced wholly or in part without written permission provided the byline, resource area, and any hyperlinks remain in order to give proper credit to the author.

Internet search engines and directory listings are imperative to your sites existence and success. Submit Your Website to the Searchen Networks directory and search engine to achieve authoritive inbound links.

Please Rate this Article

 

Click the XML Icon Above to Receive Computers Articles Via RSS!
mainarticles
Main Articles. All Rights Reserved. © 2005, 2006
Use of our service is protected by our Privacy Policy and Terms of Service.
mainarticles
 

Powered by Article Dashboard