8.7. Ten Cool Things You Can Do in Your Registry
Armed with your new understanding
of the Windows XP Registry, you're no doubt ready to
get in there and start exploring. Hopefully, this chapter has
provided the "lay of the land" you
need to get and keep your bearings in the otherwise confusing
wilderness of the Registry. While we don't have the
kind of room in this book it takes to make you an expert, we would
like to send you on your way by pointing out some interesting
landmarks; i.e., ten cool changes you can make in your own Registry.
- Expand the scope of IE's AutoComplete
feature . In Internet Explorer, you can enter an incomplete URL (i.e.,
oreilly instead of www.oreilly.com) and IE will attempt to
complete the address itself by searching for all instances. However,
IE only searches the .com,
.edu, .net , and
.org top-level domains (TLDs) by default, and
only tries the www prefix. To add new domain
suffixes and prefixes to search, go to:HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Internet Explorer\Main\UrlTemplate
- By default, this key has four values in Windows XP: 1, 2, 3, and 4,
set to www.%s.com, www.%s.net,
www.%s.org, and www.%s.edu,
respectively. The value names (the numbers) specify the search order
(lower numbers take precedence), and the data specifies the format.
Feel free to rearrange the existing items, remove unwanted items, or
add new TLDs, like entire branch in the Registry is used
as a template with which to create new user profiles. As described
earlier in this chapter, the path:HKEY_USERS\.DEFAULT
is duplicated for each new user that is created in Windows XP. If,
down the road, you trace a certain problem to an incorrect Registry
setting, you can just visit this branch and obtain the default value.
For example, I recently ran into a problem caused by incorrect data
in the UserPreferenceMask value, located in
HKEY_CURRENT_USER\Control
Panel\Desktop. I looked up the corresponding value
in HKEY_USERS\.DEFAULT\Control
Panel\Desktop, and copied its data into the active
UserPreferenceMask value. Problem solved!Another use of this key, especially for those who need to configure a
large number of users, is that any change made to the
.DEFAULT branch will appear in each new user that
is added to the system (existing users won't be
affected). This can be a great way, for example, to disable the
system sounds for each student account on a classroom computer. - Disable the Shut Down command .If you're running a kiosk or demo system (or if you
just don't want people shutting down your machine),
you can disable the
Shut Down command by going to:HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Policies\Explorer
Create a new DWORD value in this key and name it
NoClose. Double-click the new value, and set its
data to 1. You'll have to log out and log back in
(or restart Windows) for this change to take effect. Note that in
order to shut down now, you'll have to press
Ctrl-Alt-Del, and click Shut Down. To undo this change, just delete
the NoClose value. - Registry Editor remembers where you were .Each time you open the
Registry Editor, it automatically expands
the branch you had open the last time Registry Editor was used, but
no others. So, if you find yourself repeatedly adjusting a particular
setting and then closing Registry Editor (such as when implementing
the previous tip), make sure the relevant key is highlighted just
before Registry Editor is closed, and that key will be opened next
time as well.Note also the Favorites menu, which works very much like the one in
Internet Explorer, allows you to bookmark frequently accessed
Registry keys. While it's useful, I personally find
the existence of such a feature in a troubleshooting tool like
Registry Editor to be more than a little eerie. - Change the registered user and company names for Windows
XP .When
Windows XP is installed, a user and
company name are entered. Unfortunately, there is no convenient way
to change this information after installation. Surpriseyou can
do it in the Registry! Just go to:HKEY_LOCAL_MACHINE\Software\Microsoft\Windows NT\CurrentVersion
The values you need are RegisteredOwner and
RegisteredOrganization, both of which can be
changed to whatever you'd like. You may notice that
the Registry key containing these values is in the Windows NT branch,
rather than the more commonly used Windows branch.
Don't worry, both branches are used in Windows XP.
The less-used Windows NT branch contains more advanced settings,
mostly those that differentiate the Windows 9x and Windows NT lines
of operating systems (as described in Chapter 1). - Change your default installation path .When you install Windows XP, the
path to your
installation files is set in the Registry. Unfortunately, this
setting is not updated when drive letters change or when you point to
a different location when optional components are added or removed.
To change the default setup path, making subsequent configuration
changes more convenient, go to:HKEY_LOCAL_MACHINE\Software\Microsoft\Windows\CurrentVersion\Setup
Start by changing the SourcePath value to either
the root directory of your CD drive (e.g. d:\),
or to a path on your hard disk or network containing the Windows XP
installation files. Note also the Installation
Sources entry, which is a REG_MULTI_SZ
value (see Section 8.1, earlier in
this chapter, for details on this value type). It contains a list of
all the folders displayed in Windows' drop-down
list, allowing you to quickly point to any one of several favorite
installation paths. - Try something new with My
Computer .Double-click the
My
Computer icon, and the My Computer window appears. It
doesn't have to be this way. The program launched
when you double-click My Computer is simply another value in the
Registry. Start by navigating to:HKEY_CLASSES_ROOT\CLSID\{20D04FE0-3AEA-1069-A2D8-08002B30309D}
(See the following tip for an easy way to locate this key)You'll notice that the structure of this key is very
similar to standard file type keys (discussed earlier in this
chapter), which means we can treat this object like a file type and
create new actions for it. Open the Shell subkey, and create a new
key named open; in the new Open key, create a new
key named command. You should then be here:HKEY_CLASSES_ROOT\CLSID\{20D04FE0-3AEA-1069-A2D8-08002B30309D}\shell\open\command
Double-click on the default value of that new Command key and type
the full path and filename of the program you wish to open. For
example, I find it handy to have the My Computer icon open an
Explorer window; to do
this, just type explorer.exe for the value data.
You'll have to log out and log back in for the
change to take effect. - Some handy Registry navigation
shortcuts .The previous tip involved navigating to the
Registry key associated with the My Computer icon on the Desktop,
which is located in the HKCR\CLSID branch. If you
visit this branch, you'll notice hundreds of Class
ID keys, all sorted alphabetically (so to speak), which makes finding
a single key rather laborious. Luckily, there are a few alternatives
that will greatly simplify this task.First, you can simply search the Registry for "My
Computer." Start by highlighting the key at the top
of the tree (coincidentally named "My
Computer"), which instructs Registry Editor to begin
searching at the beginning. Then, use EditFind, type
My Computer, make sure that all
the "Look at" options are checked,
and click Find Next. The first instance it finds will probably be the
key you're looking for, although it
won't always be this easy.Another shortcut is to use the keyboard. Like Explorer, when you
press a letter or number key, Registry Editor will jump to the first
entry that starts with that character. Furthermore, if you press
several keys in succession, they will all be used to spell the target
item. For example, to navigate to:HKEY_CLASSES_ROOT\CLSID\{20D04FE0-3AEA-1069-A2D8-08002B30309D}
start by expanding the HKEY_CLASSES_ROOT key.
Then, press C + L +S quickly in succession, and Registry Editor will
jump to the CLSID key. Next, expand that key by pressing the (+)
button, or by pressing the right arrow key, and press { + 2 + 0 (the
first three characters of the key name, including the curly brace),
and you'll be in the neighborhood of the target key
in seconds. - Permanently remove many unwanted system tray
icons .
In Section 8.3.4,
earlier in this chapter, the
HKLM\SOFTWARE\Microsoft\Windows\CurrentVersion\Run
key is described as listing many programs that are run automatically
when Windows starts. Some of these entries are included in
order to install icons in the system tray (the area on your Taskbar,
by the clock). Since most of the tray icons that come with Windows
can be toggled on and off in Control Panel, the more bothersome ones
are usually installed by third-party programs. To disable one or more
of these tray icons, preventing them from loading the next time
Windows starts, you'll have to delete the
corresponding value in this key (renaming isn't
sufficient). Use caution, and certainly make a Registry patch to back
up the entire key before fiddling with it. - Alphabetize your Start menu in one
step .
The Windows XP Start menu allows you to rearrange shortcuts by
dragging and dropping them; the unfortunate consequence of this
feature is that new shortcuts and folders that appear when
applications are installed are added to the end of the list. Now, you
can sort a single Start Menu folder alphabetically by right-clicking
any shortcut and selecting Sort by Name, but this can get tedious
very quickly. The solution to this is in the Registry; just navigate
to:HKEY_CURRENT_USER\Microsoft\Windows\CurrentVersion\Explorer\MenuOrder\Start Menu
and you'll see subkeys and values that determine the
sort order of the contents of the Start menu (and the Favorites menu,
next door). Simply delete the entire Start menu key to sort all of
the folders in your Start menu alphabetically, or selectively delete
the desired subkeys to sort corresponding folders. Note that the next
time you drag-drop a shortcut in the Start menu, Windows will
recreate these keys automatically, so you may wish to write a WSH
script (see Chapter 9) to automatically delete this
key, say, every time Windows is started.