The registry has always been the one part of Windows that virtually

an article added by: Jordan Concord at 12132007



In: Categories » » Windows registry » The registry has always been the one part of Windows that virtually

Preventing disaster is an important thing to do. No one wants a system failure or to have to reinstall Windows XP. Not the least of your problems will be the issues with product authorization, in that Windows XP, when reinstalled, must be reauthorized! You are reading this tutorial for your own particular reason. Perhaps, as I am recommending, you are here because you want to do everything possible to prevent a disaster with your Windows XP installation. Or maybe you really, really want to recover from an existing disaster. If you are recovering from a problem, you may want to skip to the section later in this tutorial titled "Restoring the Registry." For those of you who never do anything wrong, read on.

What's the Deal with the Registry, Anyway?

  

The registry has always been the one part of Windows that virtually every user neither understands nor trusts. Just when things go well, the registry gets corrupted, and it is time to reinstall everything. Note Office XP (a.k.a. Office 10) saves its registration information in a file. See tutorial 14 for a bit of information about the registration data file. The Windows XP operating system is very robust. However, many things can cause problems. For example, a hard drive failure (even a small soft error on the system drive in the registry files), a controller failure, or a more complex memory bit that sometimes doesn't set correctly all can cause many problems with Windows XP and the registry. Warning Windows XP is robust, but our hardware is not. Most Pentium systems do not have memory parity. Though earlier PC systems used memory parity, this feature disappeared quietly a few years back when memory prices skyrocketed and there was a serious effort to keep computer prices to a minimum. Most of the newest computers now do support parity for their memory (though this support may well not be in use); many of the systems still in use do not support parity, and as a result, routine memory errors won't be detected until it is much too late. One of the biggest problems with the registry is that Windows uses it constantly. The entire process of backing up and restoring the operating system is much more difficult because Windows must have the registry files open as a restore is being done. There are several ways to solve this problem: One solution is to use the backup program supplied with Windows XP. Another is to use an after-market backup program. Such a backup program has to contain the code necessary to do registry backups and restores. Tip Oh, joy! The backup program that is included with Windows XP (and Windows 2000) allows backing up to media other than tape drives. Now it is possible to back up to other hard drives (a technique that I use), Zip drives, and other storage media. However, these backup and restore techniques may not work well under your circumstances. You may already have had a registry failure, and there may be no registry backup to rely on for recovery. Backing up and recovering the registry without a tape backup was excruciatingly difficult using previous versions of the backup program. Using the ASR (Automated System Recovery) disk is easy, but you cannot simply stick in a diskette, type restore registry, and expect it to work! Windows XP does not store any registry information on the ASR disk (Microsoft recognized that the registry was becoming too large to store on a typical diskette). The Windows XP ASR disk contains only three files: autoexec.nt, config.nt, and setup.log. The directory %SystemRoot%\Repair (the same location in which they've been stored since Windows NT 4) holds all the registry files that are backed up. In fact, restoring the registry from the %SystemRoot%\Repair directory requires the Windows XP installation program. It's not that bad; you don't have to reinstall Windows, but the installation program will restore the registry from the backup, if necessary. The menu that is presented when you boot up Windows XP also allows you to restore parts of the registry based on copies of the registry saved from previous sessions. Warning Always, always make sure that you back up the registry whenever you install new software or hardware or remove anything from your computer. If you do not back up the registry, and you restore a previous copy from an old backup, the system will not work as expected!

 

Where Exactly Is the Registry?

In order to back it up, you need to know where the registry is located. Sometimes you get to the registry as if by magic the standard registry editors don't tell you where the registry is; they simply load it automatically. However, many times you need to know where to find the registry files. They're not too difficult to find; the registry's files are in the directory %SystemRoot%\System32\Config.

Side Trip: Restoring Windows XP

Restoring a copy of Windows XP from a backup can be a difficult process. First, without a working copy of Windows XP, you can't run the backup and restore programs. This means you have to install a new copy of the operating system to be able to run the restore program. You'd then use this copy of Windows XP to restore the original system from the backup. Some users will reformat the drive, reinstall Windows XP into the same directory that the original installation was made to, and restore on top of this new installation. There's nothing wrong with doing this, as long as you remember one critical point: If you installed any Windows XP service packs on your original installation, these service packs must also be installed on the new installation being used to run the restoration program. If you don't install the service packs, Windows XP restores system files from the original installation (with the service pack) on top of the new files (without the service pack); the files will be out of version sync with the existing operating system files and the registry. This will usually cause the restore to crash without much of a warning as to what happened. To perform a full restore of Windows XP (and everything else on the drive), do the following:

1. Reformat the drive. Remember that you're doing a full restore here, and nothing that was on the drive is considered valuable at this point.

2. Install Windows XP, using your original distribution CD-ROM.

3. Install the service packs that were installed with the version of Windows that is being restored. Remember that the service packs are cumulative, so you need only reinstall the last service pack. For example, if Service Pack 3 was installed, it will not be necessary to install Service Packs 1 and 2. You only need to reinstall Service Pack 3.

4. Reinstall your backup/restore program, if necessary, and begin your restoration process. The files in the %SystemRoot%\System32\Config directory that have the extensions .log or .sav contain a history that may be viewed with the Event Viewer program. For example, files with the extension .sav are saved using the Last Known Good booting process. Files with the .log extension are records of changes made to the registry when registry auditing is turned on. Though the .log and .sav files are not strictly necessary to have a working Windows XP installation, it is best to consider each of these files a member of a complete set.

Warning Be careful not to replace one file in the registry without replacing all the others. It is simply too easy to get one file out of sync with the remaining registry files, and this would spell disaster.

Are Two Copies Better Than One?

Generally, two of anything is better than one. It's easier to ride a bicycle than a unicycle. However, it is even easier to drive a car you don't even have to keep your balance. Where the registry is concerned, keeping at least two copies of it is a good idea. I'd recommend that you keep at least four:

• The copy created by the Windows XP backup program, which is stored in %SystemRoot%\Repair. The Windows XP Setup program is able to use this copy to restore the registry.

• A backup copy of the registry files found in %SystemRoot%\Repair, saved in a safe and convenient location. Consider a Zip drive or some other type of removable storage media for this copy.

• One (or more) backup copies, created using a backup technique on a type of media that is compatible with the backup and restore program of your choice. (I'll discuss backup methods to use in the next section.)

• A copy of the registry files contained in %SystemRoot%\System32\Config stored on separate media, such as a different drive, diskettes, a Zip drive, CD-RW, or some other easily accessible, writeable media. Try to avoid media requiring special drivers and such, because these drivers may not work when you need to restore that pesky registry. This copy may only be made by dual-booting into another copy of Windows XP (or Windows 95/98/Me if the drive is FAT compatible). Note In Windows NT 4, keep the special copy created by the RDisk utility that is stored in the Windows NT directory %SystemRoot%\Repair. This copy of the registry can only be used by the Windows NT Setup program to repair an existing copy of Windows NT. Also keep the copy created by the RDisk utility that is stored on the Windows NT ERD. Again, this copy of the registry can only be used by the Windows NT Setup program to repair an existing copy of Windows NT. Windows XP doesn't support RDisk. Instead, the registry backup and ASR disk-creation functionality is incorporated into the finallyuseful- for-everyone Backup program. Be absolutely sure you keep these copies secure. Lock 'em up, stash 'em away. Oh, and by the way, that lock on your desk drawer is not good enough; use a good fireproof safe or strong box.

Danger, Will Robinson, Danger!

Throughout this tutorial and this tutorial we talk about backing up the registry to diskettes, other drives, and tapes. That's all well and good. However, you must remember that the registry contains sensitive information, especially if it is for a Windows XP server. The registry is the heart and soul of the Windows XP operating system. It contains information critical to both the operation and security of Windows XP. There are many ways that someone could use your backup registry files to breach your system's security, perhaps costing you money or (gasp!) your job. Be absolutely sure you maintain the highest levels of security for any copies of the registry that you make. If saved to external media (diskettes, tapes, or Zip drives, for example), make sure these copies are securely locked up. Why? Someone could, with little effort, completely subvert system security and then use the backup copies of the registry to hide their actions. I recommend you use a quality fireproof safe or a strong box for storing your registry backup copies. Me, I use a fireproof, locked strong box inside a federal government–rated Mosler safe and I don't think I'm being overly protective, either.

legal notice

Our website is not responsible for the information contained by this article. Web-articles is a free articles resource.
Suggestion: If you need fresh, daily updated content for your website, feel free to use our service. Click here for more information.

Useful tools and features

The registry has always been the one part of Windows that virtually  
If you like this article (tutorial), please link to it from your web page using the information above.

related articles

1. Some users of Windows know exactly what the registry is
What Is a Registry and Why? Overview Some users of Windows know exactly what the registry is a system designed to cause users and administrators to lose their hair. I know this is true because I can no longer feel the wind ruffling through my hair. Oh, I feel the wind; I just don't feel the hair. The registry is a simple, hierarchical database of information that Windows operating systems (and some applications) use to define the configuration of the system. Originally, in the early, simple days of ...

2. A value may contain one or in some instances more than one data item
Data Values A value may contain one or, in some instances, more than one data item. The only type of multiple-item value entry that the registry editor can handle is REG_MULTI_SZ, which may contain zero, one, or more strings. Data is stored in a number of different formats. Generally the system uses only a few simple formats, while applications, drivers, and so forth may use more complex types defined for a specific purpose. For example, REG_RESOURCE_LIST is a complex registry type used primarily by drive...

3. You can choose from several methods to back up your registry
Backup Techniques You can choose from several methods to back up your registry, and you can store your backed-up version on a variety of media. Whether you use the Windows XP Backup program or similar utilities, DOS commands, or the Registry Editor, you should first understand what type of file systems your computer network uses. Windows XP supports two different file systems. The first file system, called FAT (File Allocation Table), is identical to the file system used with both DOS and Windows 95/98/Me. The...

4. Once you install a second copy of Windows XP
Customizing the Boot Menu Once you install a second copy of Windows XP, your boot menu will list both copies of Windows XP. This can be confusing since the descriptions will be almost identical. There is a solution: the boot menu can be customized. The boot drive's root directory contains a file called boot.ini. This file includes the boot options for each copy of Windows XP that is installed. Edit boot.ini by following these steps: 1. Open the Windows XP Control Panel in Classic view. 2. Open System Proper...

5. A registry that has been backed up using copy or xcopy is restored
Recovering a Copied Registry A registry that has been backed up using copy or xcopy is restored in the opposite manner from which it was backed up. For example, if you have the NTFS file system, then you have to restart the system using your backup copy of Windows XP. FAT and NTFS When restoring a registry on a FAT-based file system running Windows XP, it's necessary to boot DOS, Windows 95/98/Me, or a second copy of Windows XP. If you have a dual-boot installed (either DOS or Windows 95/98/M...

6. The Windows XP Recovery Console is a tool that allows recovery
The Recovery Console The Windows XP Recovery Console is a tool that allows recovery from a number of failures. Previously, all you could do was boot another copy of Windows XP and hack your way around, replacing files, even registry components, in the blind hope that you would somehow fix the problem. With Windows XP, you have two tools to use: the Recovery Console and the Safe Mode feature. The Recovery Console is a powerful, simple (no, that's not an oxymoron!) feature that is supplied with Windows XP, but it i...

7. What the registry is and the terminology used for its various components
Anatomy of the Registry–The Blood, Gore, and Guts Overview In tutorial 1, we talked a little about what the registry is and the terminology used for its various components. In tutorial 2, we covered backing up and restoring the registry. In this tutorial, we will get into more of the details of what actually is in the registry. If you're only interested in how to use (or recover) the registry, but not what the registry is, it's possible to skip this tutorial. However, if you're unsure about this,...

8. The current control set is copied into the Last Known Good control set
When Is the Current Control Set the Last Known Good Control Set? At some point in the boot process, the current control set is copied into the Last Known Good control set. In Windows XP, the process of replacing the Last Known Good control set is done after the initial logon is performed. This allows the system to catch any problems related to the logon process. HKEY_USERS: Settings for Users Let's take a closer look at SIDs. No, despite what you may think, SID is not the kid down the street;...

9. Windows XP uses only one registry editor
Registry Tools and Tips–Getting the Work Done Overview Windows XP uses only one registry editor. Gone are the separate RegEdit and RegEdt32 editors that existed in Windows 2000. No matter which command you enter in Windows XP, RegEdt32 or RegEdit, the same program (RegEdit, which is called the Registry Editor) will run. Windows XP also has a utility called REG that is included as part of the system installation no more needing to install a separate Resource Kit. This tool is run at the comman...

10. The Registry Editor allows you to quickly create
Creating, Renaming, and Deleting Entries The Registry Editor allows you to quickly create, delete, or rename an entry. Entries may consist of keys, subkeys, or value entries. Creating a New Key You can quickly create a new key by following these steps: 1. Select the hive or key in which the new key is to be created. Either right-click the object or select Edit → New, and then select the type of object to create. 2. The Registry Editor creates the new subkey, giving it a default name of N...