You are currently offline, waiting for your internet to reconnect

Environment variables in Windows NT

This article was previously published under Q100843
There are three levels of environment variables in Microsoft Windows NT; thesystem environment variables, the user environment variables, and theenvironment variables that are set in the AUTOEXEC.BAT file. There arealso some predefined environment variables that are set when the userlogs on. This article discusses the following topics:

  • System environment variables
  • User environment variables
  • AUTOEXEC.BAT environment variables
  • How environment variables are set
  • How the path is built
  • Changing user environment variables by using Control Panel

System environment variables

System environment variables can be viewed from Control Panel bychoosing the System icon. These variables are always set no matter whologs on and they cannot be changed by any user.

There are a few additional predefined environment variables that areset when the user logs on that do not appear in the System dialog box:

   USERNAME   USERDOMAIN   NTVERSION (not available in Windows NT 4.0 anymore)   WINDIR   OS   PROCESSOR_ARCHITECTURE		
values: x86, MIPS or ALPHA
values for x86: 3, 4, 5 values for MIPS: 3000, 4000 values for ALPHA: 21064
These three environment variables are set based on the value of the home directory. The user's home directory is specified in User Manager (Choose Profile and Properties). If the home directory uses universal naming conventions (UNC), then they will have the following values:

HOMESHARE=\\<server name>\<share name> HOMEPATH=\<path> HOMEDRIVE=<drive letter>:

If the home directory is a local path such as c:\nt then they will look like this:


All above environment variables are always present and therefore maybe used in log on scripts.

User environment variables

User environment variables can be viewed from Control Panel as well.The user may add, delete or modify the environment variables in theUser Environment Variables for User field. These variables takeprecedence over system environment variables. The user path isappended to the system path.

AUTOEXEC.BAT environment variables

All environment variables and the paths set in the AUTOEXEC.BAT fileare used to create the Windows NT environment. Any paths in theAUTOEXEC.BAT file are append to the system path.

How environment variables are set

Environment variables are set in the following order:

  • System variables
  • AUTOEXEC.BAT variables
  • User variables

How the path is built

The Path is constructed from the system path, which can be viewed inthe System Environment Variables field in the System dialog box. TheUser path is appended to the system path. Then the path from theAUTOEXEC.BAT file is appended.

Note: The environment variables LibPath and Os2LibPath are built thesame way (system path + user path + AUTOEXEC.BAT path).

Changing user environment variables by using Control Panel

User environment variables can be added, changed or deleted fromControl Panel. There is no need to reboot after making any of thesechanges. Changes take effect immediately after exiting the Systemdialog box.

The next application you start will use the new settings. All otherapplications running before the changes were made will not recognizethe changes.
prodnt winnt

Article ID: 100843 - Last Review: 02/20/2007 00:20:09 - Revision: 3.3

  • Microsoft Windows 2000 Server
  • Microsoft Windows 2000 Advanced Server
  • Microsoft Windows 2000 Professional Edition
  • Microsoft Windows NT Advanced Server 3.1
  • Microsoft Windows NT Server 4.0 Standard Edition
  • Microsoft Windows NT Workstation 3.1
  • Microsoft Windows NT Workstation 4.0 Developer Edition
  • kbenv KB100843