Add or change the values of environment variables

Updated: January 21, 2005

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

To add or change the values of environment variables

  1. Open System in Control Panel.

  2. On the Advanced tab, click Environment Variables, then click the name of the user variable or system variable you want to change, as follows. Click one of the following:

    • New to add a new variable name and value.

    • Edit to change a current variable name and value.

    • Delete to remove a variable name and value.


  • Do not add directories to the Path system variable unless you know they are secure because a malicious user could place a Trojan horse or other malicious program in that directory. When executed by Windows, such a file could compromise sensitive data, cause data loss, or cause a partial or total system failure.


  • To perform this procedure, you must be a member of the Administrators group on the local computer, or you must have been delegated the appropriate authority. If the computer is joined to a domain, members of the Domain Admins group might be able to perform this procedure. As a security best practice, consider using Run as to perform this procedure.

    If you are not logged on as administrator to the local computer, the only environment variables you can change are user variables.

  • To open System, click Start, click Control Panel, and then double-click System.

  • To open System from a command line as an administrator, type:

    runas /user: computername \Administrator "rundll32.exe shell32.dll,Control_RunDLL sysdm.cpl"

  • Windows saves changes in the registry so they are available automatically the next time you start your computer.

  • Changing user variables changes them only for the logged-on user. For example, if you use run as to log on as administrator and you change user variables, only the variables for the administrator account are changed. Changing system variables, however, changes them for every user.

  • You might have to close and reopen running programs for the new settings to take effect.

  • You can remotely add or change the values of environment variables using System Properties in the Computer Management snap-in. For more information, see Related Topics.

Information about functional differences

  • Your server might function differently based on the version and edition of the operating system that is installed, your account permissions, and your menu settings. For more information, see Viewing Help on the Web.

See Also

Community Additions