Working with Hive Files

There are two scenarios in which working with hive files is an important part of an IT professional's job. The first is when creating a default user profile, which you learn how to do in Chapter 10, "Deploying User Profiles." The other is troubleshooting. You can take a hive file from a computer or user profile that's not working properly, repair it on another computer, and then replace it on the original computer.

Loading a hive file is different from importing a hive file. When you import a hive file, which you learned how to do in the previous section, you actually replace settings in the registry. In other words, you load the hive file over existing settings. When you load a hive file, you create a whole new branch in the registry that doesn't overlap or replace any other branch. This enables you to edit the settings in a hive file without changing your own settings. Here's how to load a hive file in to the registry:

  1. In the key pane, click either HKU or HKLM.

  2. On the File menu, click Load Hive.

  3. In the File Name box, type the path and file name of the hive file you're loading, and then click Open.

  4. In the Key Name box, shown in Figure 2-6, type the name you want to assign to the hive.

    click to expand
    Figure 2-6: Type a name that describes what the hive file contains.

The name you give to the key is arbitrary. Use any name that helps you identify the hive file that you're loading. All you're doing in this step is creating a root key in which to load the hive file.

When you're finished editing settings in the hive file, you must unload it before doing anything else with it, such as copying it to a removable disk. That's because Windows XP locks the file until you unload it. Unloading a hive file is easy: Click the key into which you loaded the hive, which you specified in step 4, and then click Unload Hive on the File menu. If you get an error message when you try to copy the hive file or profile folder that contains a hive file, it's usually because you forgot to unload it from the registry.

start sidebar
Command-Line Alternative

Windows XP comes with a killer command-line alternative to Regedit. Anything you can do with Regedit you can do with Console Registry Tool for Windows. And this tool installs with Windows XP, unlike earlier versions of Windows, which required you to get the tool from the resource kits.

What's so great about a command-line registry editor? You can use it to script registry changes. For example, you can write a batch file that automatically backs up a portion of the registry. Imagine a batch file that extracts hardware information from a computer and dumps it on to a network share. That's a quick inventory system. Recently, I used Reg.exe to extract the GUID (see Chapter 1, "Learning the Basics") from every computer on a network so that I could configure them as managed computers in Active Directory. This was a huge timesaver.

Chapter 9, "Scripting Registry Changes," describes Console Registry Tool for Windows, otherwise known as Reg.exe, in great detail. If you want to learn more about it now, just type Reg.exe at the MS-DOS command prompt.

end sidebar



Microsoft Windows XP Registry Guide
Microsoft Windows XP Registry Guide (Bpg-Other)
ISBN: 0735617880
EAN: 2147483647
Year: 2005
Pages: 185

flylib.com © 2008-2017.
If you may any questions please contact us: flylib@qtcs.net