Microsoft windows xp registry guide




















For more information about how to back up and restore the registry, see How to back up and restore the registry in Windows XP and Windows Vista. Skip to main content. This browser is no longer supported. Download Microsoft Edge More info. Contents Exit focus mode. Please rate your experience Yes No. Any additional feedback? Note Security features in Windows let an administrator control access to registry keys.

Note There is a 64K limit for the total size of all values of a key. Warning Serious problems might occur if you modify the registry incorrectly by using Registry Editor or by using another method. In this article. Contains the root of the configuration information for the user who is currently logged on.

The user's folders, screen colors, and Control Panel settings are stored here. This information is associated with the user's profile. This key is sometimes abbreviated as HKCU. Contains all the actively loaded user profiles on the computer. Contains configuration information particular to the computer for any user. This key is sometimes abbreviated as HKLM. The information that is stored here makes sure that the correct program opens when you open a file by using Windows Explorer.

This key is sometimes abbreviated as HKCR. Contains information about the hardware profile that is used by the local computer at system startup. Raw binary data. Most hardware component information is stored as binary data and is displayed in Registry Editor in hexadecimal format. Data represented by a number that is 4 bytes long a bit integer. These are the basic steps that you'll rely on throughout this book. Changing Values I promise that That's not going to stop me from telling you about other ways you can change a value, however.

One way to change a value is to click Edit, Modify. Regedit displays a different editor depending on the value's type. This version has dialog boxes for almost all the value types that Windows XP supports.

The following graphics show what the different editors look like, with a description of each. Enclosing the value in quotes isn't necessary unless you intend to include the quotes in your value. You can copy values from this dialog box to the clipboard, which is a nifty way to get values into scripts and documents. By default, you're editing a hexadecimal value, but you won't include any prefixes such as 0x in the value; you just type the hexadecimal digits.

You can edit the value as a decimal number by selecting the Decimal option. The first column of numbers in this dialog box is the offset, starting from zero. The second column of numbers contains the binary string in hexadecimal notation. The last column shows the text representation of the binary string. You can edit either the second or third columns.

You can type hexadecimal digits or plain text. Each string is on its own line with no blank lines. To change a value, click Edit, Modify, and then type the value's new data in the Value Data box. When you change a value using Regedit, the editor immediately applies that change to the registry, but that doesn't mean Windows XP or other programs have noticed the change.

In fact, all changes go unnoticed until the program or operating system has a reason to load or reload that value from the registry. For example, if you change the Windows Explorer settings in the registry, open windows won't reflect those changes—you must close and reopen those windows. If you customize Microsoft Office XP, you must shut down and restart it before it'll recognize your changes. Chances are pretty good that you're going to mess up something. Unless you have access to a test lab, you're likely to experiment on your production computer read production as essential.

If things get out of hand, don't panic, and by all means, don't make things worse by restarting your computer over and over again or whacking away at the registry until there's nothing left. Instead, see Chapter 3, "Backing up the Registry" to learn how to easily recover your recent working configuration. Stupid Clipboard Tricks If you're writing scripts, documentation, deployment plans, and so on, you'll be typing a lot of key names and values.

You can copy value names and data to the clipboard, too. Value names don't tend to be long, but using the clipboard is the only way to ensure you have the value's data correct. This is a great way to back up data before changing it. Before changing a value, copy its data to the clipboard, create a new value of the same type, and paste the data on the clipboard into it.

Adding Keys or Values The only reason you would create keys and values is if you were instructed to do so; that is, you know adding the value will have some effect. For example, Microsoft's Knowledge Base often instructs you to add a value that fixes a certain problem. Throughout this book, you learn about values you can add to the registry that customize Windows XP.

Otherwise, adding a value that no program reads doesn't accomplish anything. When you create a new key, Regedit names it New Key N, where N is an incremental number beginning with 1, and then selects the name so you can change it. In the Key pane, click the key in which you want to add a value. Type a name for the new value. Regedit names the new value New Value N and then selects it so you can type a new name. Windows XP requires all names contained in a key to be unique.

No two subkeys can have the same name and no two values can have the same name. The default data for binary values is null, or no value whatsoever. The default value for strings is the empty string. After you create a new value, you edit it to change its value from the default. I don't delete settings often, but there are a few circumstances that recur. The first is when I want to reset a program's settings.

For example, to reset Regedit's view settings, you must remove the value that contains them. You can wipe out most programs' settings by wiping them out of the registry. Another circumstance is when I want to tidy up the registry a bit. Often, the registry contains references to files that don't exist orphans or settings that just shouldn't be in the registry anymore, particularly after removing a program. With a little thought and a little luck, you can clean these settings out of the registry.

Chapter 3, "Backing up the Registry," is a helpful resource for either scenario. Tip There's a better, safer way to remove keys and values than just paving over them. You can rename settings you want to remove, which hides them from any code that's looking for them. Just add your initials to the beginning of the key or value's name.

Then if something goes terribly wrong, and it happens from time to time when digging around in the registry , I can remove the current version of Session and give the old version its original name.

Instead, you click the key or value that you want to rename, and then click Rename on the Edit menu. You can also click the key or value you want to rename, and then press F2. In the previous section, "Deleting Keys and Values," you learned that one of the main reasons I rename keys and values is to hide them from Windows XP and other programs instead of permanently deleting them.

Then, only after I'm happy with the result, I permanently remove the item. Sometimes I don't even bother to do that, as renamed keys serve as good documentation for the changes I make in the registry. To rename a key or value, select the key, click Edit, Rename, and type a new name. I confess that I've never printed anything in the registry; I just haven't found a good reason to do it. You can certainly print subkeys as a backup before making changes, but I tend to use hive files for that purpose, which doesn't require me to retype keys, values, and data to restore the old settings.

You might not get much use out of this feature, but this chapter wouldn't be complete without describing how to use it. To print all or part of the registry, follow these steps: 1. Click the key you want to print, keeping in mind that you're going to print every subkey and value under it.

Click Print. The following listing shows you what Regedit's printer output looks like. As you see, it's not very useful except maybe as a temporary way to remember values. Last, this version of Regedit actually prints each value's type rather than relying on you to figure it 46 out while you're flipping through pages.

Command is one of the many commands that Reg. Options is the options that the command requires. Options usually include the name of a key, and sometimes a value's name and data. If any key or value name contains spaces, you must enclose the name in quotation marks. It gets more complicated for each of the different commands you can use with it, however, and I cover each of those in the sections following this one. You enclose environment variables in percent signs to expand them in place. Thus, to use them on the Reg.

In the previous example, if you had used single percent signs, the command prompt would have expanded the environment variable before running the command.

Using double percent signs prevents the command prompt from expanding the environment variable. First it can display the data in a specific value. Second it can display all of a key's values. How it works depends on the options you use. This is the key's path, beginning with the root key. This will query value in key. This will query the key's default value.

This will query all the key's subkeys and values. This will delete value from key. This will delete the key's default value.

This will delete all values from key. This will force Reg. Those keys can be on the same computer or different computers, making this a useful troubleshooting tool.

Why would you compare keys or values and not show the differences? The command was successful and the keys or values are identical. The command failed. The command was successful and the keys or values are different. If omitted, Reg. This compares value.

This compares the key's default value. This shows all differences and matches. This shows only differences. This shows nothing. This compares all the key's subkeys and values. This command is useful to back up subkeys, as you learned in Chapter 3, "Backing Up the Registry. The key's path, beginning with the root key.

This copies all the key's subkeys and values. This forces Reg. This command has a few limitations, though. First it works only with the local computer. You can't create a REG file from a remote computer's registry. Second it creates only version 5, Unicode REG files. This is the key you want to export to a REG file. It imports a REG file silently. This command can handle both version 4 and version 5 REG files, but it works only on the local computer.

It's a convenient method for backing up the registry before making substantial changes. Chapter 3, "Backing Up the Registry," describes this technique. This command works only on the local computer. This is the key you want to save as a hive file. This is similar to importing a hive file in Regedit. The difference between this command and loading a hive file is that this command overwrites any existing key, whereas loading a hive file creates a new temporary key to contain the hive file's contents.

Use this command to restore a backup hive file. This is the key you want to overwrite with the contents of the hive file. You reference the hive file's keys and values through the temporary key you specify on the command line.

This command is similar to loading hive files in Regedit. This is the new temporary key into which you want to load the hive file. It simply unhooks the hive file from the registry. You must remember to unload a hive file that you've loaded before trying to copy or do anything else with the hive file because Windows XP locks the file while it's in use. This is the name of the key containing the hive file you want to unload. You can write a script that inventories a computer and writes the result to a file on the network, for example.

You can automate an application to perform redundant steps automatically. The sky is the limit, really, but I'm here to tell you how to use scripts to edit the registry, so I'm confining myself a bit. The current version is 5. Windows Script Host is called a host because it's not aware of a script's language. Microsoft calls this language agnostic. Windows Script Host uses different scripting engines to parse the different languages in which you might write a script.

If you've ever used Visual Basic in any of its incarnations, you're going to be more comfortable using VBScript to write scripts. The problem with focusing this chapter on how to use scripts to edit the registry is that doing so assumes that you're already familiar with Windows Script Host. If that's not true, I suggest that you find a good book about scripts. After you've mastered the languages, which aren't difficult, you'll appreciate this Web site's reference content.

The content describes the object model and how to use it—the hardest part of writing scripts for Windows XP. Creating Script Files Script files can have two file extensions, and the script's file extension indicates which language the file contains. Use the. Regardless, script files are nothing more than text files that contain the language's keywords, so you can use your favorite text editor, Notepad, to create them.

When you save a script file, make sure you enclose the file's name in quotation marks or choose All Files from the Save As Type list so Notepad doesn't add the. Without going into detail about the object model, you access the registry through the Shell object.

This object contains the methods you call to add, remove, and update values in the registry. You'll add one of the following statements to every script in which you want to access the registry.

The first line shows you how to create the Shell object using VBScript, and the second shows you how to do it using JScript. VBScript has the benefit of not being case sensitive. Save the file using the. You'll see a message from me. CreateObject "WScript. Shell" ; WshShell. Shell" ; Why write scripts when INF files are easier? I usually write INF files to edit the registry.

I like the simplicity of these methods. There are times when writing a script is the only suitable method, however. Writing a script is necessary in a number of cases. The first is when you must have a user interface. If you want to display settings to or collect settings from users, scripting is the best choice.

Also, scripting is the only method that provides rather full access to Windows XP. For example, you can use a script to inventory the computer and dump the information to a text file on the network.

So if you're doing anything more complicated than just adding, changing, or removing values, you're going to end up writing scripts. I've seen some fairly complicated scripts. For example, one fellow I worked with wrote a script that searched the registry for services that Sysprep disabled, and then permanently removed them from the registry. This is a great example of scripting. Combined with WMI, scripting is nothing short of amazing. It displays the amount of physical memory installed on the computer, the name of the computer, the BIOS version, the type of processor, and more.

This script and many more like it are available on Microsoft's Script Center, which is a large library of scripts that you can download, modify, and use. Name Wscript. Version Wscript.

ServicePackMinorVersion Wscript. Manufacturer Wscript. WindowsDirectory Wscript. Locale Wscript. FreePhysicalMemory Wscript. TotalVirtualMemorySize Wscript. FreeVirtualMemory Wscript. Model Wscript. CurrentTimeZone Wscript. Architecture Wscript. The script engine is Wscript. The example given in the sidebar "Why write scripts when INF files are easier?

If neither is specified, the default is Wscript. You can specify up to 32, seconds. The default is no time limit. This displays available command parameters and provides help for using them. This is the same as typing Cscript.

You can set the amount of time that the script is allowed to run and whether or not the host displays a log. The result is a file with the.

It looks like your average INI file. Formatting Key and Value Names Before I show you how to edit the registry with a script, there's one more detail: how to format the names of keys and values in a script.

Unlike other scripting methods I've described in this chapter, the Windows Script Host object model doesn't have separate parameters for the key and value name. Thus, you distinguish key names and value names by how you format them. The rule is simple: If a string ends with a backslash, it's a key name; if a string doesn't end with a backslash, it's a value name.

That means that you must escape the backslashes in your keys. If you want to change a key's default value, set strName to the name of the key, including the trailing backslash, and then assign a value to it.

It can't handle larger binary values. If you want to change longer binary values or change types of values that this method doesn't support, use the Shell object's Run method to import a REG file.

For example, you can put your settings in a REG file called Settings. Run "Settings. You can add keys. You can add or change values. Use the format appropriate for the value's type.

Shell" WshShell. Be careful, however, because removing an entire branch is easy; there's no confirmation. To remove a key, end strName with a backslash; otherwise, you're removing a value. RegDelete strName object This is the shell object. To read a key's default value, end strName with a backslash; otherwise, you're reading a value. RegRead strName object strName This is the shell object. This is the string indicating the name of the value to read.

You've undoubtedly encountered package files by now. Microsoft Office and Office XP both ship as package files, which are databases of files and settings that Windows Installer installs on the computer. Creating a package file for a large application is an intense process, but creating package files that contain registry settings is straightforward. To create a package file, you need an editor. It's clunky and short on features when compared to recent versions of WinINSTALL, but it's suitable for creating package files to deploy registry settings.

Package files contain features, and features contain components. To deploy registry settings in a package file, you must create all of the above. Follow these steps to create a new package file and add registry settings to it: 1.

In the Filename box, type the path and name of the package file, and click OK. In the Name box in the right pane, type a new name for the feature. This is likely to be the only feature that you add to the package file, because all you're doing is deploying registry settings.

You can create multiple features, though, and each feature can contain different registry settings. That way, users can install or not install individual features. The package editor automatically gives the component a GUID. Components typically contain all the files and settings required to implement a program unit, so applications often have multiple components.

When using a package file to deploy settings, creating multiple components doesn't make a lot of sense. In the left pane, select the component you added, and click Registry. In the right pane, click the key in which you want to add or change a value, and then click New Value. In the Value Name box, type the name of the value. In the Data Type list, select the value's type; click OK.

In the Type Editor dialog box, type the value's data, and then click OK. Click File, Save to save your package file. After you've created a package file, you can deploy it just like any other package file. If the package file contains settings that users don't have permission to change, you can deploy it through Active Directory and Group Policy, which installs package files with elevated privileges.

You can also execute the command that installs a package file, which is msiexec. The computer's settings affect every user who logs on to Windows XP. Computer settings include hardware configuration, network configuration, and so on. Typically, only the administrators group can change computer settings, but some settings are within reach of the Power Users group.

On the other hand, a user profile contains settings for a specific user. Users customize the operating system to their liking, and their settings don't affect other users. Users have full control of their own profiles, which contain more than just settings. They also contain files and folders specific to each user. Deploying and managing user profiles are two of the most significant issues facing IT professionals. Properly deploying and managing user profiles can save companies money.

That's because most of the behaviors that users experience in Windows XP have settings in user profiles, and IT professionals can deploy user profiles that contain defaults for these settings, starting users off on the right foot. For example, they can populate the Favorites folder with links to the intranet so users don't have to find those links for themselves. They can add printer connections to a default user profile so users can print right away without having to figure out how to add a printer.

Importantly, most of the useful policies that manage operating system and application settings are in user profiles. IT professionals manage the settings in user profiles by applying policies to them.

Doug Gough rated it liked it Jul 18, MTOldtymer rated it it was amazing Oct 22, Chad Rowe rated it liked it Oct 17, Adam added it Apr 29, Aneecka added it Dec 07, Eugene added it Apr 22, Lisa added it Jun 06, Heng added it Mar 30, Ben added it Aug 31, Starfighter added it Oct 19, Les added it Mar 25, Teufel Wolf added it Apr 12, Ralph added it Oct 16, Tarik Shaban added it Nov 16, Shailesh marked it as to-read Feb 27, Clayton Eric added it Feb 27, Andrew Talbert added it Mar 10, Yaroslav Metlitskyi marked it as to-read Mar 24, Araf Karsh added it Jun 03, Archipestre added it Jun 06, George Kalaizis marked it as to-read Jun 10, Bugmenotdamnit marked it as to-read Jul 18, Physically, Windows XP organizes the registry in hives, each of which is in a binary file called a hive file.

These backups allow the operating system to repair the hive during the installation and boot processes if something goes terribly wrong. All other root keys are links to keys within those two. In Windows , System. What you should get out of this table is that each hive in the first column comes from the files in the second column. LOG Software, Software. Evt, SecEvent. Evt, and SysEvent. The remaining subkeys come from two different sources, though.

Each time a new user logs on to Windows XP, the operating system creates a new profile for that user using the default user profile. The profile contains a new Ntuser. This key contains one subkey for each profile that the operating system has ever loaded, past or present.

Note Windows limited the size of the registry, but Windows XP does not. This means that the operating system no longer limits the amount of space that the registry hives consume in memory or on the hard disk. Microsoft made an architectural change to the way Windows XP maps the registry into memory, eliminating the need for the size limit you might have struggled with in Windows With Registry Editor, you affect settings without the help of a user interface.

On the other hand, nothing is checking the settings you change for sanity. Every version of Windows since 3. The editor in Microsoft Windows 95 can search the registry and has a simple to use interface. Microsoft Windows NT 4. Now, with Windows XP, you get the best of both editors in a single program insert applause for the developers here. Registry Editor in Windows XP is the tool you learn about in this chapter.

This chapter contains more than just instructions for how to use the editor, though. Imagine what life as an IT professional or power user who supports friends and relatives would be like if Microsoft advertised this program to every Windows XP user on the planet. For example, I recently used a program that changed critical settings while it was running, and then restored them when the program shut down.

Unfortunately, the program crashed without restoring the settings and the only way I could get them back to their original values was to edit the registry.

Regedit and Registry Editor are one and the same. Click Start, Run, and type regedit to run Regedit. If you want to start Regedit even quicker, drag Regedit. IT professionals can prevent users from running Regedit.

They can set the Disable registry editing tools policy in Group Policy, local or otherwise. I cover these topics in detail elsewhere in this book. Shareware registry editors also circumvent Software Restriction Policies and permissions that you apply to Regedit. In reality, determined users will always find a way to hack away at the registry, so part of the solution must be a corporate IT policy that you clearly communicate to users.

Exploring Regedit With all its power, Regedit is still a simple program with a straightforward user interface. Its few menus are simple. It has a status bar that displays the name of the current key. Its window contains two panes, split by a divider that you can drag left or right to change the size of both panes.

On the left is the key pane; on the right is the value pane. The value pane displays the settings that each key contains. Regedit saves its settings every time you close it. The next time you start Regedit, the window will The columns will also be the same size. Last, Regedit reselects the last key that you selected.

You no longer have to flip back and forth between both registry editors to complete most tasks. Additionally, Windows XP makes substantial improvements to the registry itself. Second, the registry is faster in Windows XP than in earlier versions of Windows.

Windows XP keeps related keys and values closer together in the database, preventing page faults that degenerate into disk swapping. All in all, the registry in Windows XP is significantly faster to query than it was in Windows At the top, you see My Computer, which represents the local computer. Following each root key are its subkeys. The term branch refers to a key and all its subkeys. Click any key to see its values in the value pane.

You can use the mouse pointer to explore the registry, but using the keyboard is much more efficient when you know the keyboard shortcuts that are available. These are quick ways to move around the registry while expanding and collapsing entire branches at the same time.

Regedit displays all the hive files together to show a single, unified registry, though. In Regedit, you can see when a branch is its own hive because its name is capitalized.

For example, all the subkeys under HKLM are hives, so their names are capitalized. When you change a value in Regedit, Windows XP updates the appropriate hive file. Refer back to Chapter 1 if you need a refresher on how Windows XP stores the registry on disk. In this pane, you see three columns: Name, Type, and Data.

You can change the size of each column by dragging the dividers left or right. I typically use about half the pane to display the Name and Type columns and the remainder of the Each row contains a single value. The Type column indicates the type of data in that value. To get a better glimpse of binary values, click View, Display Binary Data. I promise. For instance, you might want to figure out why a program runs every time you start Windows XP.

You can search key names, value names, and string data. The first hit can take a long while to show up, so be patient. After Regedit finds a hit, it selects the key or value it found. On the Edit menu, click Find. Use more characters or require full matches to get fewer hits. To find keys whose name contains the text, select the Keys check box.

To find values whose name contains the text, select the Values check box. Click Find Next. Press F3 to repeat your search if necessary. You can significantly cut down the time it takes to search the registry by narrowing the focus to keys, values, or data. For example, if you know that you want to search only for values that contain certain characters in their names, limit your search to value names. Searching Incrementally Incremental searching makes finding subkeys and values in long lists much faster.

Type d without delaying too long so as not to restart the incremental search and Regedit selects WMDFile. You get the idea. That is, incremental searching only finds keys that you can see by scrolling the key pane up or down. It searches only for key names, value names, or string values. The solution is straightforward, though. Export the branch that you want to search to a REG file.

Then open the REG file in Notepad, and search for the number or binary string you want to find. You have to know how Regedit formats values in REG files to find them, however.

Thus, Jerry as a binary string is 0x 4A 0x00 0x65 0x00 0x72 0x00 0x72 0x00 0x79 0x To find binary strings in a REG file that contain the word Jerry, search for 4a,00,65,00,72,00,72,00, Chapter 9 describes the format of every value type and what they look like in REG files.

This enables you to bookmark the subkeys that you edit most frequently and return to them quickly. Clicking a subkey on the Favorites menu is certainly a better alternative to clicking your way through the key pane or, worse yet, trying to remember where Windows XP stores the Run key in the registry. In the Add To Favorites dialog box, type a descriptive name for your shortcut.

You might like to have some help getting your Favorites menu going. On the Favorites menu, click Remove Favorite, and then click the keys you want to remove. Edit the REG file to sort the keys in alphabetical order, or any other order that you prefer, and then import the REG file back in to the registry after removing the Favorites key. The Favorites menu is resorted. Save this REG file, by the way, so you can use your favorites elsewhere.

Click a subkey near where you want to begin, and then search. As you repeat your search by pressing F3, keep an eye on the status bar and note the key that contains the current hit. For that matter, do an incremental search to speed things up.

Shareware Search Tools A variety of shareware tools are available for searching the registry. They are far more advanced than Regedit and designed specifically to make digging around the registry easier and quicker. You can download evaluation versions of these tools at any shareware site. Registry Crawler not only searches the registry faster than Regedit, but it has features that make the task easier.

You can access it quickly from the system tray. It presents a list of matches that you see all at once, rather than bouncing around from hit to hit, and you can export the results to a REG file. It also enables you to search the registries of multiple computers at one time if you have access to them over a network.

You can also change most values. Use whichever method is right for you, but I prefer keyboard shortcuts because I deplore touching the desktop rodent without a reason. You can edit any value by selecting it and pressing Enter. The following sections describe the features that Regedit provides for editing the registry.

Changing Values I promise that One way to change a value is to click Edit, Modify. This version has dialog boxes for almost all the value types that Windows XP supports. The following graphics show what the different editors look like, with a description of each. You can copy values from this dialog box to the clipboard, which is a nifty way to get values into scripts and documents. You can edit the value as a decimal number by selecting the Decimal option.

The first column of numbers in this dialog box is the offset, starting from zero. The second column of numbers contains the binary string in hexadecimal notation. The last column shows the text representation of the binary string. You can edit either the second or third columns. You can type hexadecimal digits or plain text. Each string is on its own line with no blank lines. In fact, all changes go unnoticed until the program or operating system has a reason to load or reload that value from the registry.

You can copy value names and data to the clipboard, too. This is a great way to back up data before changing it. Before changing a value, copy its data to the clipboard, create a new value of the same type, and paste the data on the clipboard into it. Adding Keys or Values The only reason you would create keys and values is if you were instructed to do so; that is, you know adding the value will have some effect.

Throughout this book, you learn about values you can add to the registry that customize Windows XP. When you create a new key, Regedit names it New Key N, where N is an incremental number beginning with 1, and then selects the name so you can change it. Creating a new value is similar: 1. In the Key pane, click the key in which you want to add a value. Type a name for the new value.

Regedit names the new value New Value N and then selects it so you can type a new name. Windows XP requires all names contained in a key to be unique. No two subkeys can have the same name and no two values can have the same name. The default data for binary values is null, or no value whatsoever.

The default value for strings is the empty string. After you create a new value, you edit it to change its value from the default. Another circumstance is when I want to tidy up the registry a bit. With a little thought and a little luck, you can clean these settings out of the registry. Then if something goes terribly wrong, and it happens from time to time when digging around in the registry , I can remove the current version of Session and give the old version its original name.

Instead, you click the key or value that you want to rename, and then click Rename on the Edit menu. You can also click the key or value you want to rename, and then press F2. To rename a key or value, select the key, click Edit, Rename, and type a new name. Printing the Registry Regedit has a feature that prints all or part of the registry. To print all or part of the registry, follow these steps: 1.

Click Print. Exporting Settings to Files Exporting all or part of the registry is one of those things IT professionals and power users do often. By exporting, I mean copying portions of the registry to another file, typically a REG file but hive files are more useful.

This is a great way to back up settings so you can easily restore them later, if necessary. First is deployment. The differences between the four are significant, and you learn about them later in this chapter.

Follow these steps to export branches of the registry to files:. Click the key at the top of the branch you want to export. Click Save. Importing a file into the registry is similar to opening a file. Each type is a different file format and thus suited to different purposes than the other types. Each section name represents a key, and each item in a section represents a value. For example, the letter A is 0x, not 0x In the previous section, you learned how to import REG files using Regedit.

For example: regedit settings. For example, exporting hardware settings from the Windows NT 4. Use common sense. That means that each character is a single byte wide. The letter A is 0x Each format has strengths and weaknesses that make it appropriate for some tasks and useless for others.

This section should help you choose the right format each time. Exporting to hive files is my choice most of the time. They are the same format as the Windows XP working hive files, so they represent settings exactly the same way. When restoring keys from a backup after an unsuccessful registry edit, this is exactly the behavior you want.

Hive files have one more strength that make them my choice most of the time: You can load them as new hives and view their contents without affecting other parts of the registry. Although hive files are my choice most of the time, there are a few scenarios that require me to use REG files.

Hive Files Hive files are binary files that contain portions of the registry. Regedit displays all these hives together in one logical unit.

Hive files are useful tools, though. You can export branches to hive files that can then be imported to another computer or by another user. Exported hive files have purposes similar to REG files. The advantage that hive files have over REG files is that you can load and edit them in Regedit without actually replacing your own settings.

They are one and the same. 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. This enables you to edit the settings in a hive file without changing your own settings.

On the File menu, click Load Hive. The name you give to the key is arbitrary. 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. And this tool installs with Windows XP, unlike earlier versions of Windows, which required you to get the tool from the resource kits.

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. Recently, I used Reg. This was a huge timesaver. If you want to learn more about it now, just type Reg. These are the basics that you must know to perform routine tasks such as changing registry values.

You also learn how to protect the registry. The sad part is that after spending hours reinstalling the operating system and incumbent applications, I discovered an easy fix for the problem. Most of these tools have a higher calling than just backing up and protecting the registry.

System Restore ensures that you can roll back the configuration of Windows XP to an earlier snapshot, which the operating system makes automatically.

Pick the one or two techniques that work for you and stick with them. I prefer to save keys to hive files before making changes to the registry, but you might prefer to make backup copies of individual values. Also, you definitely want to know about System Restore and how to fix troublesome settings.

The last part of this chapter describes the advanced troubleshooting tools, which you turn to only when things are so fouled up that you have no other choice. Many of these tools require advance preparation.

For example, to restore a backup copy of the registry, you must have made a backup. Likewise, to use Automated System Recovery, you must have created the disk. The first is making backup copies of values, which you can quickly restore in the registry. Backups also document the changes you make. The third method and my first choice when making significant changes is to export branches to hive files.

System Restore can get you out of trouble most of the time; it fails only when Windows XP is so far gone that it no longer starts properly. Tip Do you find yourself making the same changes over and over again? I tend to customize the same settings every time I install Windows XP or every time I log on to a computer and get a new user profile. Test the script carefully so you can apply it with assurance that it works properly. Test them againevery time you change them.

Copying Single Values The easiest way to leave a way out if things go wrong is to make backup copies of values before changing them.

Then add a new value using the original name and type, but with new data. The effect is the same, and you can always restore the value by restoring its name. This is your Undo feature. Print or save your screenshot for future reference. Your settings are tucked away safely, and you can edit that branch knowing that restoring the original values will be easy.

Restoring your backup REG file is easy, too. Type the name of the REG file that contains your settings, and then click Open. No No. You can back up and restore keys for other users.

On the File menu, click Connect Network Registry, and type the name of the computer containing the registry you want to open. When you import a hive file containing a key, Regedit completely replaces the current key and all of its subkeys with the contents of the hive file. That means that Regedit removes any value you added since backing up the registry to a hive file. This is a far more accurate way to back up branches before editing them. Exporting branches to hive files is similar to exporting them to REG files; you just pick a different file type.

Reverse the process to restore your settings: Click File, Import; then click Registry Hive Files in the Save As Type list, type the name of the hive file to which you backed up your settings, and then click Open.

You can use any file extension you like, but I prefer to give hive files the. Unloading the hive file just unlinks the file from the registry. You can unload only hive files you manually loaded and not hive files Windows XP loaded. Whereas importing a hive file is a great way to restore an entire branch, loading a hive file is a good method to restore settings surgically or just to check an original value.

Examine the setting in the hive file you loaded, or even copy the backup setting and then paste it over the current value. You can also use it to restore, load, and unload hive files.

With Reg. See Chapter 9 for a full explanation of all the different options. Description Save the branch starting with the key keyname to the hive file called filename.

Windows XP and most applications are incredibly resilient, though, so fixing a problem is a simple matter of telling it to heal thyself. This is tantamount to uninstalling and reinstalling an application. The difficult part is figuring out which value contains the troublesome setting.

So back up any setting you delete before you try this troubleshooting technique. Managing Settings to Avoid Problems IT professionals dodge most problems with settings by managing them properly. The first and most important practice is not to dump users into the local Administrators group. Policies are another good way to manage settings. Moving users out of the local Administrators group saves your company money by reducing lost downtime and deviations from corporate standards, but policies actually help you recover money from your IT investment.



0コメント

  • 1000 / 1000