Customizing Your PC with the Windows XP Registry

Customizing Your PC with the Windows XP Registry

Published: June 24, 2002
* *
* *

Editor's Note: Past articles by members of the online community are archived for your use. The information may become outdated as technology changes. For the most current information, please search the Web site or post a question in the newsgroups.

The Windows XP registry is the database in which the operating system stores most of its settings. It's where programs store their settings. It contains information about what hardware is installed on the system. Importantly, the registry defines relationships between different parts of the operating system's user interface. For example, the registry defines what you see on the desktop; how the Start menu and taskbar work; and how the operating system starts.

Mastering the registry can enhance your experience with Windows XP. There are countless ways to customize Windows XP using the registry. Enthusiasts refer to this practice as "hacking the registry." Don't worry, it's legal. The slang term has persisted even though "hacking" today usually refers to illegal activity.

When it comes to the registry, some hacks are small. Others change Windows XP in substantial ways. Once you get started, there are many good Web sites that contain more registry customizations, including WinGuides and JSI, Inc.

My new book, Microsoft Windows XP Registry Guide, published by Microsoft Press, comes out in October. It provides in-depth coverage of the Windows XP registry for power users and IT professionals. You'll find out about the contents of the registry; how to backup your settings; and how to use the registry as a deployment and management tool. It also contains many more hacks that you can use to enhance Windows XP. In future columns for the Expert Zone, I'll provide more detailed information about the registry.

Making Changes to the Registry

You can change registry settings to customize how the operating system looks and feels. Many settings can't be changed by using a Windows XP user interface, such as a dialog box. Instead, you must change them in the registry.

You can edit the registry manually, using the Registry Editor (Regedit.exe), or you can use scripts, which is the method that I prefer because they're quicker to use than Regedit and they're testable. After verifying that a script works, I can use it repeatedly without worrying about breaking something due to my feeblemindedness.

In this column, I'm showing you a few of my favorite registry hacks for beginning and advanced users. Advanced users already know their way around Regedit and can edit these settings directly, using the Registry Editor. (Although even advanced users should be aware that if you use Registry Editor incorrectly, you can cause serious problems that may require you to reinstall your operating system. Microsoft recommends that before you edit the registry, you back up the registry and understand how to restore it if a problem occurs. See the Microsoft Knowledge Base article, How to Back Up, Edit, and Restore the Registry in Windows XP).

Beginning users should use the listings I've added to this column, which automatically change the registry for them.

Using Scripts to Edit the Registry

In this column, I'm helping you create scripts, which are listings that you copy into Notepad that automatically make changes to the registry.

Note:  When using Notepad to create the listings in this column, Notepad adds the .txt extension to files by default. For example, if you type Sample.reg in the Save As dialog box, Notepad saves the file as Sample.reg.txt. This isn't helpful, because you can't import the file by double-clicking it. There are two ways to force Notepad to save the file using the .reg extension. The first is to enclose the entire file name in quotation marks. The second is to click All Files in the Save as type list. Either way, make sure the file has the .reg extension.

Follow these steps to create a registry script:

1.

Click the hyperlinked listing to open it in a separate window.

2.

Copy the text in the listing to Notepad, being careful to select all the text.

3.

Save the file using the .reg extension.

4.

Double-click the file to import it into the registry.

5.

Click Yes in the Registry Editor message box, and another message box tells you if you've successfully entered the information in the registry.

Hiding the Recycle Bin

How do you remove the Recycle Bin icon from the desktop? Microsoft removed the other icons from the desktop but not the Recycle Bin icon. I suppose it's because emptying the trash wouldn't be as easy without it.

Listing 1 hides the Recycle Bin. There are different ways to hide the icon, but this is the best method. It hides the Recycle Bin icon whether you're using the classic or new Start menu. Use Notepad to create a text file called Hidebin.reg. Copy Listing 1 to Hidebin.reg, and then double-click the file to import it into the registry. If you miss the Recycle Bin icon and want to show it again, create the text file Showbin.reg and copy Listing 2 in to it. Double-click Showbin.reg to restore the Recycle Bin icon to the desktop.

Both listings require you to refresh the desktop in order to see your changes. To do that, click anywhere on the desktop, and then press F5.

Listing 1

Listing 2

Add Recycle Bin to Folder Options

Listings 1 and 2 are the direct way to hide the Recycle Bin icon. To demonstrate one of the cooler ways to hack the Windows XP registry, I'll show you a better way to hide the icon. We'll give it a user interface.

Listing 3 does just that. It extends Folder Options by adding an option for showing the Recycle Bin icon on the desktop. Customizing the key HKLM\SOFTWARE\Microsoft\Windows\CurrentVersion\Explorer\Advanced\Folder is how you add options to this dialog box. Advanced users can use this key as a guide for how to extend it. Beginners can use this script to add an option for the Recycle Bin icon: Save Listing 3 below in the text file Binopt.reg and then double-click it. After importing Binopt.reg into the registry, a new option is listed in the Folder Options dialog box that lets you configure the Recycle Bin icon, as shown in Figure 1.

To hide or show the Recycle Bin icon using Folder Options, follow these steps:

1.

In Windows Explorer, on the Tools menu, click Folder Options.

2.

On the View tab, under Advanced Settings, do one of the following:

Select the Show Recycle Bin icon on the desktop check box to show the icon on your desktop.

Clear the Show Recycle Bin icon on the desktop check box to remove the icon from your desktop.

Listing 3

Clear History Lists

Ever wondered how to get rid of the different history lists that Windows XP keeps? The operating system keeps track of the programs you run using the Run dialog box, the documents you've opened, and the files for which you've searched. Sometimes clearing these lists is useful, particularly if you share an account with other users and want to prevent prying eyes from seeing what you've been doing. Listing 4 removes the most common history lists from the registry. Save it as the text file Cleanmru.reg and double-click the file to remove these lists.

Listing 4

For advanced users, you can clear these history lists every time you log on to Windows XP if you prefer. Add to HKCU\Software\Microsoft\Windows\CurrentVersion\Run the REG_SZ value ClearMRU. Set the value of ClearMRU to the command line that imports the file Clearmru.reg. For example, if the file is in C:\Windows, the command is C:\Windows\Regedit.exe /s C:\Windows\Clearmru.reg. The command-line option /s imports the file silently.

Rename the My Computer Icon

If you show the My Computer icon on your desktop, you should customize it. Why? Well, because you can. First, you can rename the icon to make it more personal. Wouldn't you rather see Jerry's Computer instead of My Computer, assuming your name is Jerry?

You can right-click the My Computer icon to rename it. There's a better way, though, and that's to change the name in the registry and include an environment variable in the name. Environment variables are strings that contain information about the environment for the system and the currently logged on user. Using the environment variable %USERNAME% in the name of the My Computer icon will automatically change the icon's name for every user who uses the computer. (If you want to see what other environment variables are available, type set at the command prompt, and press Enter.)

Listing 5 sets the name of the My Computer icon to %USERNAME%'s Computer. Windows XP substitutes your account name for %USERNAME%. Incidentally, this also changes the name of the My Computer icon on the Start menu. Create the text file Mycomp.reg, copy Listing 5 to it; and then double-click the file.

Listing 5

Customize My Computer's Shortcut Menu

Don't stop with renaming the My Computer icon, though. Do you use Tweak UI? How about Regedit? I like to put both of these tools on the My Computer shortcut menu so that they're within easy reach. Save Listing 6 as the text file Shortcuts.reg and double-click the file. To quickly open Tweak UI, right-click My Computer, and then click Tweak. To quickly open Regedit, right-click My Computer, and then click Registry. Figure 2 shows this new menu.

Listing 6

I hope the hacks you learned here whet your appetite for learning more about the registry. Tune in to the Expert Zone for future columns containing more detailed information about the registry.

Expert Zone Columnist Jerry Honeycutt is a writer, speaker, and technologist who has written over 25 books, including Microsoft Windows XP Registry Guide (Microsoft Press, 2002). He frequently writes about customizing and deploying Windows XP

你可能感兴趣的:(windows)