Compartir a través de


Registry settings

Applies To: Windows Server 2003, Windows Server 2003 R2, Windows Server 2003 with SP1, Windows Server 2003 with SP2

Registry settings

Programs store configuration information in a system database called the registry. For configuration purposes, the two most important sections of the registry are labeled HKEY_LOCAL_MACHINE and HKEY_CURRENT_USER.

You should store information that pertains to the entire system in HKEY_LOCAL_MACHINE. For example, a program might store the following information in this section:

  • The components of a program that were installed.

  • The path used to load program components.

  • The path to a shared database. For example, a point-of-sale program where all users reference the same database.

Programs store user-specific information in the HKEY_CURRENT_USER section, which is part of the user profile. When a user logs on, a profile is loaded into the system registry where it becomes HKEY_CURRENT_USER. When the user logs off, any changes to HKEY_CURRENT_USER are written back to the user profile. A program might store the following types of information in this section:

  • Per-user paths are particularly important for multiuser operation. For example, paths to custom dictionaries, mailboxes, configuration files, and temporary directories.

  • Per-user preference settings. For example, some users might want to enable background spell checking while others might want to disable it.

Per-user data in HKEY_LOCAL_MACHINE

Problems arise if programs store per-user data in HKEY_LOCAL_MACHINE instead of HKEY_CURRENT_USER. If a program stores personal preferences, such as color and font size, in HKEY_LOCAL_MACHINE, users are not able to specify custom preferences.

Settings created when a program is run

A program might create HKEY_CURRENT_USER registry settings the first time a user runs the program, rather than during installation. If you do not run the program while install mode is still active, the HKEY_CURRENT_USER settings are not copied to HKEY_LOCAL_MACHINE. The first time each user runs the program, HKEY_CURRENT_USER will be loaded with the default settings. Depending on the program, this might or might not be appropriate. If the default settings are not sufficient, they need to be corrected for each user individually.

To avoid this problem, run the program once before clicking Finish in Add\Remove Programs (or before running change user /execute). This will cause the program to create the necessary registry settings.

If you have already left install mode and have not run the program, re-enter install mode with change user /install and run the program. If you have already run the program while in execute mode, create another administrator account, log on with this new account, run change user /install, run the program, and then run change user /execute to leave install mode. For more information about the change user command, see Change user.