Team LiB   Previous Section   Next Section

11.7 HKCU

We all like to customize our environments. We do it at home, at work, in our cars, and pretty much anywhere else we can get away with it. When you customize your Windows 2000 or NT environment and applications, the changes end up in subkeys of HKCU, which is actually a link to your SID's subkey under HKU. Only a currently logged-in user has access to HKCU. It can't be edited remotely (RegEdit disallows remote user access to HKCU and HKCC), nor can a SID key under HKU be edited while someone with a different SID is logged in.

The contents of HKCU vary more than any of the other root keys because applications store their user-specific settings here too. If Ellen and Joe share a computer, their respective HKCU subkeys can end up looking very different: Ellen might install and use Netscape, Visual Studio, and BoundsChecker, while Joe might stick with Office 2000 and Internet Explorer. Accordingly, in this section I'll confine my discussion to the most important subkeys of HKCU.

11.7.1 HKCU\ AppEvents

For better or worse, Microsoft included the capability in NT 4.0 (and Win95, too) to associate sounds with system events such as opening or closing windows, logging out, and so on. This feature certainly falls into the customization arena, and application developers can add their own event classes. For example, if you install Microsoft's Visual Studio, you can get audio alerts when your compilation succeeds, when the debugger hits a breakpoint, and so on.

The event-to-sound mappings are stored in HKCU\AppEvents. Each event that has a sound associated with it has the name of the .wav file to play as the content of its default value. For a fun prank, write a Perl script that randomly assigns .wav files from %systemroot%\media to random events.[6]

[6] The publisher and I jointly disclaim any liability arising from you doing this to your boss, spouse, or co-workers.

11.7.2 HKCU\Console

MS-DOS command-line interface is, to put it politely, extremely limited. If you're used to a powerful Unix shell such as bash, zsh, or tcsh, you know what I mean. The really weak spot, though, is the appearance and behavior of the console window; after all, you can always write command scripts in Perl, KixStart, or REXX, but you're stuck looking at them through that old throwback 80x24 white-on-black ugly-font DOS window!

Fortunately, the Windows 2000 and NT console is customizable, so you don't have to suffer any longer. The customization settings all live under HKCU\Console, and they're so self-explanatory (guess what FontSize does) I won't cover them here.

11.7.3 HKCU\Control Panel Items

Each installed control panel may have its own subkey and settings beneath HKCU\Control Panels. HKU\.DEFAULT has default settings for all the control panels, so HKCU\Control Panels may not contain as many values as you'd expect. Additionally, many control panels (notably Network and Multimedia) store their settings in other parts of the Registry.

11.7.4 HKCU\Environment

The Environment key contains whatever environment variables are set in the "User Variables" list of the System control panel's Environment tab. They're stored as name-value pairs. For some reason, some variables are stored as REG_SZ entries, while others are stored as REG_EXPAND_SZ. It doesn't seem to matter what's in the value, either; some nonexpandable strings are still tagged as REG_EXPAND_SZ. Weird.

11.7.5 HKCU\Printers

The system stores information about printers the current user may use in HKCU\Printers. Each printer gets its own value entry directly under HKCU\Printers. This entry specifies what the default printer for this particular user is. The printer settings themselves (for all printers, not just the default one) are actually stored in HKLM\SYSTEM\CurrentControlSet\Control\Print\Printers for Windows 2000 machines and HKLM\SYSTEM\CurrentControlSet\Services\Print\Printers for NT.

11.7.6 HKCU\Software\Microsoft

As you've no doubt inferred from the name, user-specific settings for Microsoft components are stored under this key. Until you install Internet Explorer and/or Microsoft Office on a machine, though, there are relatively few of these keys; most system settings are stored under HKLM, and there aren't that many settings to hold here.

11.7.6.1 Microsoft\ NtBackup

The bundled backup applications included with Windows 2000 and NT have a fairly large number of settings in it. All these settings can be manipulated using the program's standard user interface, but you may be interested in setting some of them via group or system policies. For example, the NtBackup\UserInterface\UsePassword flag can be set to require that backup tapes be password-protected. There are a number of subkeys that fall under Microsoft\NtBackup:[7]

[7] And ntbackup doesn't even know it; it's using an INI file remapped to this key.

Backup Engine

The values under this subkey control the actual backup process: how many buffers should be reserved for the tape drive, whether Mac files on an NTFS volume should be backed up, and so forth.

Debug

If you're having problems getting a backup device to work, you can configure debug logging through the values in this key.

Display

These settings store your choices of font size, window position, and other display parameters.

Hardware

The settings you choose for whatever type of tape hardware your system has are stored here.

Logging

You can turn on logging for individual backup jobs through the ntbackup user interface. When you do, these values are used to figure out whether the log file should be printed and what the root of its filename should be.

Translators

These settings store NT Backup translator information.

User Interface

The catch-all key, this holds values that don't have a place anywhere else, such as whether the tape should be ejected when the backup completes or whether the backup should be automatically verified when it's done.

For a more complete explanation of the ins and outs of NTBACKUP, see O'Reilly's Windows NT Backup and Restore.

11.7.6.2 Microsoft\ RAS Autodial

The Dial-Up Networking autodialer's settings are stored under this key, which retains its name for backward compatibility.

Addresses

Each time you establish an autodialed connection, DUN stores the address that caused the dialing in a value under Addresses. The IP address or DNS name serves as the value name for each entry. Entries under Addresses have three values: Tag, LastModified, and Network.

Control

This subkey is where the actual control settings for the autodialer live. There are only three of them:

DisabledAddresses

This REG_MULTI_SZ stores a list of IP addresses or DNS names for which an autodialed connection will never be established. You can use this list as an extremely low-rent blocking proxy by filling it with addresses of sites you don't want to connect to.

LoginSessionDisable

I have no idea what this is for. It appears to be set by the RasGet-AutodialParm( ) API routine. If you know what this does, I'd love to hear.

DisableConnectionQuery

Ordinarily, DUN pops up a little dialog asking you for permission to start a connection when it needs one. This is annoying because if you start something that requires a connection, you have to stay there to answer the dialog; its default action button is "No, don't dial." You can subdue this annoyance by setting DisableConnectionQuery (a REG_DWORD) to 1. This forces DUN to always start a dialup connection when one is required.

Locations

There's one subkey of Locations for each dialing location you have defined.

Entries

Likewise, there is one subkey under Entries for each phonebook entry you've used. The value for an entry is of the form NetworkX, where X is some small integer. This indicates which DUN dialup adapter you used to make this connection.

Networks

This key has subkeys named after the values of Entries' subkeys: Network0, Network1, and so on. Each of these entries in turn has a value named "1" that points back to an entry under Entries.

11.7.6.3 Microsoft\RAS Monitor

The RAS Monitor key stores settings for the Dial-Up Networking monitor. Nine of the fourteen values stored here track the window size and position of various monitor windows; the other five are flag and setting values whose structure isn't documented.

11.7.6.4 Microsoft\RAS Phonebook

The systemwide set of DUN phonebook entries is stored in %systemroot%\system32\ras\rasphone.pbk. This file (or the personal phonebook files you can create and use instead) holds the phone numbers, network settings, and login credentials for each entry in your phonebook.[8] These settings can differ widely between entries; you might have one entry for your ISP that tells DUN to use server-supplied values for everything and another for dialing in to your office intranet that uses a fixed set of IP, DNS, and gateway addresses.

[8] .pbk files are plain text, so you can inspect and edit them to your heart's content. You can also copy them from one machine to another; this is an easy way to get a consistent set of phonebook entries for a group of machines.

The values beneath Microsoft\RAS Phonebook control DUN dialing for all entries in the phonebook. As you can see, they provide a fairly rich set of options.

AllowLogonLocationEdits and AllowLogonPhonebookEdits

These two REG_DWORD s control whether users may change their dialing location or phonebook entry during login. They're only effective if you've enabled the option to allow logging on via DUN. Note that when you change these parameters in the Appearance tab of the Logon Properties dialog from within rasphone, these values are actually changed in HKU\.DEFAULT\Software\Microsoft\RAS Phonebook, not in HKCU.

AlternatePhonebookPath

If you specify an alternate phonebook in the User Preferences dialog's Phonebook tab, the path to that phonebook appears here.

AreaCodes

In the Basic tab of the Edit Phonebook Entry dialog, you can specify whether you want to use the TAPI dialing properties or not. If you do, you can enter an area code for the phonebook number. This REG_MULTI_SZ tracks the area codes you've entered in the phonebook.

CallbackMode

DUN supports three callback modes via this value. They apply only if the remote server offers to perform a callback. The first option, set if this REG_DWORD is 0, tells the DUN client to refuse callback requests. A value of 1 (the default) specifies that DUN should ask you whether you want to accept it or not, and a value of 3 means "yes, always accept a callback if requested."

CloseOnDial

When it's set to 1, as it is by default, this REG_DWORD tells DUN to close the phonebook application when it's finished. Set this value to to keep the phonebook application open after dialing completes.

DefaultEntry

This REG_SZ specifies which phonebook entry appears as the default entry when you open the Dial-Up Networking phonebook. Adjust it to make a particular entry appear.

ExpandAutoDialQuery

Before DUN autodials for you, it may ask you to confirm that you really want to dial (unless you have "Always prompt before auto-dialing" unchecked in the Appearance tab of the User Preferences dialog). When it does ask for confirmation, the "Settings" button in the confirmation dialog shows additional controls for choosing a location and turning off the confirmation requests in the future. Setting ExpandAutoDialQuery to 1, its default, makes these extra controls immediately visible. Setting it to requires users to hit the Settings button to see them.

IdleHangUpSeconds

This value specifies the number of seconds a DUN connection may be idle before the client hangs it up. The value should be in seconds; a value of tells DUN to never hang up.

LastCallbackByCaller

I don't know what this is for either.

NewEntryWizard

As with so many other Windows 2000 and NT components, the DUN phonebook features a wizard that ostensibly helps you create new entries. The Appearance tab of the User Preferences dialog features a checkbox that lets you specify whether you want to use the wizard or not; this REG_DWORD reflects that value.

OperatorDial

You can toggle a DUN setting that tells it not to dial because you'll be dialing manually. This REG_DWORD value reflects that option; when it's 1, that means that the system waits for you to dial before attempting to connect.

PersonalPhonebookFile

Besides the alternate phonebook file, you may specify an individual phonebook file for your own use (after all, this is HKCU !). If you specify a personal phonebook in the User Preferences dialog's Phonebook tab, the path to that phonebook appears here.

PhonebookMode

This REG_DWORD specifies which phonebook DUN uses. The default value of means that %systemroot%\system32\ras\rasphone.pbk is used; a value of 1 means that the user's personal phonebook is used, and a 3 means that the value in AlternatePhonebookPath is used.

Phonebooks

This REG_MULTI_SZ keeps a list of all the phonebooks you've ever specified in AlternatePhonebookPath so it can build a combo box listing them for your later reference.

Prefixes

This REG_MULTI_SZ contains a list of all the prefixes you've ever specified for phone entries in your phonebook. This allows DUN to present a nice combo box listing your previous choices.

PreviewPhoneNumber

This REG_DWORD reflects the setting of the "Preview Phone Number" checkbox in the Appearance tab of the Edit Phonebook Entry dialog. When it's set to 1, users may edit the phonebook entry's number before it's dialed.

RedialAttempts

By default, if a connection doesn't happen on the first attempt, DUN quits trying. This happens because the default value of RedialAttempts is 0. You can enable as many retries as you'd like, and DUN will patiently keep trying until it connects or makes the specified number of attempts.

RedialOnLinkFailure

This value (a REG_DWORD) specifies whether DUN should automatically resurrect a failed connection. Sometimes a connection drops for no good reason; setting this value to 1 causes DUN to redial and restart the connection if it fails.

RedialSeconds

This value specifies the number of seconds (15 is the default) to wait between redial attempts, assuming you've set RedialAttempts to greater than 0.

ShowConnectStatus

This REG_DWORD has two possible values: 1 (the default) displays a connection progress dialog that indicates what's happening on the connection, and suppresses the dialog (useful when you're making connections via command-line scripts).

ShowLights

In a nod to the Win95 way of doing things, NT's DUN can display some little blinking lights in the system tray to duplicate the front-panel LEDs of most external modems. The Dial-Up Networking Monitor is in charge of this vital function. By default, this REG_DWORD's value is 1, meaning that the DUN Monitor will be started before the connection is--therefore, the lights will be present. If you don't enjoy seeing them (or, more likely, if you're not paying any attention to the system tray), you can set this value to to hide them.

SkipConnectComplete

Until you tell it otherwise, DUN displays a dialog saying you've successfully connected. One of the options in this dialog is a checkbox that says "Don't show this dialog again." That checkbox controls the value of SkipConnectComplete: when it's 1, that tells DUN to omit the dialog. By default, its value is 0, so you'll see this dialog until you manually turn it off.

Suffixes

Like Prefixes, this value's a REG_MULTI_SZ. Its purpose is to store a list of any suffixes you've ever specified for a DUN phone number.

UseLocation

By default, you can select any of the installed TAPI locations when making a DUN connection. This is especially useful if you have a machine that frequently moves between different area codes or countries. However, if you want to keep users from changing their location from the DUN phonebook, just set this REG_DWORD to instead of its default value of 1. (Note that users can still use the Modems control panel to change locations.)

UseAreaAndCountry

I haven't been able to identify what this does.

WindowX and WindowY

These values specify the (x,y) location of the upper-left corner of the DUN phonebook window.

Besides this cornucopia of values, Microsoft\RAS Phonebook has an additional subkey, Callback. Every installed modem device on the system has its own subkey under Callback, named after the device (e.g., Callback\Standard Modem (COM2)). If you set the callback mode to "always call me back at this number," the number you supply for that device goes in the subkey's Number value. This provides a convenient way to preset a callback number, perhaps as part of a mass laptop installation.

11.7.6.5 Microsoft\Windows\CurrentVersion

A surprising amount of code originally developed for Win95 has found its way into NT 4.0 and ultimately Windows 2000. In fact, Microsoft's eventual goal is to unify the Win9x and NT lines until what's left is a nice Win9x interface over the security, performance, and scalability of NT. To facilitate this merging, Microsoft included a compatibility key, Microsoft\Windows\CurrentVersion, in the NT 4.0 and Windows 2000 Registries. This allows applications that use this key on Win95, like Explorer and Internet Explorer, to run on NT and Windows 2000 systems without modification.

11.7.6.6 Microsoft\Windows NT\CurrentVersion

Much like the Microsoft\Windows subkey which holds information for applications that were designed to run on Win95 machines, this Windows 2000 subkey contains subkeys that represent different versions of Windows 2000, NT 4.0 and earlier. Most notably, the CurrentVerions subkey stores user-specific configuration data for programs that are designed to run on the latest version of Windows 2000.

The Microsoft\Windows NT key appears to be a migration of the previous NT key HKCU\Microsoft\Windows NT. They both contain subkeys that represent the current operating system versions (see the next section) and contain similar keys and values, with the following Windows 2000 additions:

Event Viewer

Event Viewer is a Windows 2000 MMC snap-in that displays event logs written to by Windows 2000 applications and services. The Event Viewer subkey stores information about the configuration of this snap-in.

Extensions

Through Window Explorer (or the Registry), you can associate filename extensions with programs that are run when you open the file. Values under this subkey specify default command line executions for filename extensions that are not associated with programs.

PrinterPorts

Entries under this subkey contain information about printers, such as name, driver name, port, and timeout value, that the client is connected to.

Task Manager

Task Manager is a performance tool that displays application, process, and performance information (you've likely used it if you've ever had to terminate a application that wasn't responding). This subkey contains Task Manager preferences.

TrueType

This subkey contains information about the display of TrueType fonts.

11.7.7 figs/nt4icon.gif HKCU\Microsoft\Windows NT\CurrentVersion

This key is pretty much a mixed bag: it holds user-specific settings that have no home elsewhere. For example, NT's Server Manager applications store their settings in a subkey of Windows NT\CurrentVersion\Network even though they might more properly live under HKCU\Software\Microsoft\ServerManager or somesuch.

Devices

The Devices subkey contains one value entry for each installed printer on a system. Apart from that, it doesn't seem to do anything else.

Network

The Event Viewer, Server Manager, and User Manager all keep their small sets of user-specific settings here. The only other interesting item is the PersistentConnections subkey, which contains a list of shares that NT should reconnect when the user logs in again.

Program Manager

The entries under this key are retained for older applications that expect to find things here.

Windows

Just as with Program Manager, this key primarily exists for backward compatibility, especially with the WOW subsystem.

Winlogon

Alone among the subkeys of Windows NT\CurrentVersion, Winlogon actually has three useful values beneath it. They duplicate similar entries in HKLM\SOFTWARE\Microsoft\Windows NT\CurrentVersion\Winlogon, but these entries apply only to the currently logged in user.

ParseAutoexec

This REG_DWORD specifies whether to parse autoexec.bat when the user logs in, resulting in the autoexec.bat path statement being appended to the system path created by Windows NT. 1 (the default) means yes; means no.

ProfileType

Specifies the profile type of the current user's profile. A 1 means it's a local profile; other values indicate a cached, roaming, or mandatory roaming profile.

RunLoginScriptSync

If this REG_DWORD is set to 1, any logon script for this user is run before the desktop and shell are started. This is the default. Setting the value to allows the logon script process to run in parallel with the shell as it starts.

    Team LiB   Previous Section   Next Section