Difference between revisions of "Windows environment variables"

From WPKG | Open Source Software Deployment and Distribution
Jump to: navigation, search
m
 
(7 intermediate revisions by 3 users not shown)
Line 1: Line 1:
{| style="margin: 1em 1em 1em 0; background: #f9f9f9; border: 1px #aaa solid; border-collapse: collapse;" border="1"
+
This is a list of Windows environment variables / Windows system variables.
|ALLUSERSPROFILE || Local returns the location of the All Users Profile.
+
 
 +
See also [[changing / adding environment variables]] to see how to manipulate these values or add your own (silently).
 +
 
 +
{| style="background: #f9f9f9; border: 1px #aaa solid; border-collapse: collapse;" border="1"
 +
|'''ALLUSERSPROFILE''' || Local returns the location of the All Users Profile.
 
|-
 
|-
| APPDATA || Local returns the location where applications store data by default.
+
| '''APPDATA''' || Local returns the location where applications store data by default.
 
|-
 
|-
| CD || Local returns the current directory string.
+
| '''CD''' || Local returns the current directory string.
 
|-
 
|-
| CMDCMDLINE || Local returns the exact command line used to start the current cmd.exe.
+
| '''CMDCMDLINE''' || Local returns the exact command line used to start the current cmd.exe.
 
|-
 
|-
| CMDEXTVERSION || System returns the version number of the current Command Processor Extensions.
+
| '''CMDEXTVERSION''' || System returns the version number of the current Command Processor Extensions.
 
|-
 
|-
| COMPUTERNAME || System returns the name of the computer.
+
| '''COMPUTERNAME''' || System returns the name of the computer.
 
|-
 
|-
| COMSPEC || System returns the exact path to the command shell executable.
+
| '''COMSPEC''' || System returns the exact path to the command shell executable.
 
|-
 
|-
| DATE || System returns the current date. This variable uses the same format as the date /t command. Cmd.exe generates this variable. For more information about the date command, see the Date command.
+
| '''CommonProgramFiles''' || Returns the location of the Common Files directory.
 
|-
 
|-
| ERRORLEVEL || System returns the error code of the most recently used command. A non-0 value usually indicates an error.
+
| '''CommonProgramFiles(x86)''' || Returns the location of the Common Files directory for 32-bit applications on Windows 64-bit.
 
|-
 
|-
| HOMEDRIVE || System returns which local workstation drive letter is connected to the user's home directory. This variable is set based on the value of the home directory. The user's home directory is specified in Local Users and Groups.
+
| '''CommonProgramW6432''' || Returns the location of the Common Files directory for 64-bit applications on Windows 64-bit, if running a 32-bit application.
 
|-
 
|-
| HOMEPATH || System returns the full path of the user's home directory. This variable is set based on the value of the home directory. The user's home directory is specified in Local Users and Groups.
+
| '''DATE''' || System returns the current date. This variable uses the same format as the date /t command. Cmd.exe generates this variable. For more information about the date command, see the Date command.
 
|-
 
|-
| HOMESHARE || System returns the network path to the user's shared home directory. This variable is set based on the value of the home directory. The user's home directory is specified in Local Users and Groups.
+
| '''ERRORLEVEL''' || System returns the error code of the most recently used command. A non-0 value usually indicates an error.
 
|-
 
|-
| LOGONSEVER || Local returns the name of the domain controller that validated the current logon session.
+
| '''HOMEDRIVE''' || System returns which local workstation drive letter is connected to the user's home directory. This variable is set based on the value of the home directory. The user's home directory is specified in Local Users and Groups.
 
|-
 
|-
| NUMBER_OF_PROCESSORS || System specifies the number of processors installed on the computer.
+
| '''HOMEPATH''' || System returns the full path of the user's home directory. This variable is set based on the value of the home directory. The user's home directory is specified in Local Users and Groups.
 
|-
 
|-
| OS || System returns the OS name. Windows XP and Windows 2000 display the OS as Windows_NT.
+
| '''HOMESHARE''' || System returns the network path to the user's shared home directory. This variable is set based on the value of the home directory. The user's home directory is specified in Local Users and Groups.
 
|-
 
|-
| PATH || System specifies the search path for executable files.
+
| '''LOGONSERVER''' || Local returns the name of the domain controller that validated the current logon session.
 
|-
 
|-
| PATHEXT || System returns a list of the file extensions that the OS considers to be executable.
+
| '''NUMBER_OF_PROCESSORS''' || System specifies the number of processors installed on the computer.
 
|-
 
|-
| PROCESSOR_ARCHITECTURE || System returns the processor's chip architecture. Values: x86, IA64.
+
| '''OS''' || System returns the OS name. Windows XP and Windows 2000 display the OS as Windows_NT.
 
|-
 
|-
| PROCESSOR_IDENTFIER || System returns a description of the processor.
+
| '''PATH''' || System specifies the search path for executable files.
 
|-
 
|-
| PROCESSOR_LEVEL || System returns the model number of the computer's processor.
+
| '''PATHEXT''' || System returns a list of the file extensions that the OS considers to be executable.
 
|-
 
|-
| PROCESSOR_REVISION || System returns the revision number of the processor.
+
| '''PROCESSOR_ARCHITECTURE''' || System returns the processor's chip architecture. Values: x86, IA64, AMD64.
 
|-
 
|-
| PROMPT || Local returns the command-prompt settings for the current interpreter. Cmd.exe generates this variable.
+
| '''PROCESSOR_ARCHITEW6432''' || System returns the processor's chip architecture, if running a 32-bit application on Windows 64-bit. Values: IA64, AMD64.
 
|-
 
|-
| RANDOM || System returns a random decimal number between 0 and 32767. Cmd.exe generates this variable.
+
| '''PROCESSOR_IDENTFIER''' || System returns a description of the processor.
 
|-
 
|-
| SYSTEMDRIVE || System returns the drive containing the Windows root directory (i.e., the system root).
+
| '''PROCESSOR_LEVEL''' || System returns the model number of the computer's processor.
 
|-
 
|-
| SYSTEMROOT || System returns the location of the Windows root directory.
+
| '''PROCESSOR_REVISION''' || System returns the revision number of the processor.
 
|-
 
|-
| TEMP or TMP || System and User return the default temporary directories for applications that are available to users who are currently logged on. Some applications require TEMP and others require TMP.
+
| '''PROGRAMFILES''' || Returns the location of the Program Files directory.
 
|-
 
|-
| TIME || System returns the current time. This variable uses the same format as the time /t command. Cmd.exe generates this variable. For more information about the time command, see the Time command.
+
| '''PROGRAMFILES(x86)''' || Returns the location of the Program Files directory for 32-bit applications on Windows 64-bit.
 
|-
 
|-
| USERDOMAIN || Local returns the name of the domain that contains the user's account.
+
| '''PROGRAMW6432''' || Returns the location of the Program Files directory for 64-bit applications on Windows 64-bit, if running a 32-bit application.
 
|-
 
|-
| USERNAME || Local returns the name of the user currently logged on.
+
| '''PROMPT''' || Local returns the command-prompt settings for the current interpreter. Cmd.exe generates this variable.
 
|-
 
|-
| USERPROFILE || Local returns the location of the profile for the current user.
+
| '''RANDOM''' || System returns a random decimal number between 0 and 32767. Cmd.exe generates this variable.
 
|-
 
|-
| WINDIR || System returns the location of the OS directory
+
| '''SYSTEMDRIVE''' || System returns the drive containing the Windows root directory (i.e., the system root).
 +
|-
 +
| '''SYSTEMROOT''' || System returns the location of the Windows root directory.
 +
|-
 +
| '''TEMP''' or '''TMP''' || System and User return the default temporary directories for applications that are available to users who are currently logged on. Some applications require TEMP and others require TMP.
 +
|-
 +
| '''TIME''' || System returns the current time. This variable uses the same format as the time /t command. Cmd.exe generates this variable. For more information about the time command, see the Time command.
 +
|-
 +
| '''USERDOMAIN''' || Local returns the name of the domain that contains the user's account.
 +
|-
 +
| '''USERNAME''' || Local returns the name of the user currently logged on.
 +
|-
 +
| '''USERPROFILE''' || Local returns the location of the profile for the current user.
 +
|-
 +
| '''WINDIR''' || System returns the location of the OS directory.
 
|}
 
|}
  
 
[[Category:Documentation]]
 
[[Category:Documentation]]

Latest revision as of 10:48, 16 April 2009

This is a list of Windows environment variables / Windows system variables.

See also changing / adding environment variables to see how to manipulate these values or add your own (silently).

ALLUSERSPROFILE Local returns the location of the All Users Profile.
APPDATA Local returns the location where applications store data by default.
CD Local returns the current directory string.
CMDCMDLINE Local returns the exact command line used to start the current cmd.exe.
CMDEXTVERSION System returns the version number of the current Command Processor Extensions.
COMPUTERNAME System returns the name of the computer.
COMSPEC System returns the exact path to the command shell executable.
CommonProgramFiles Returns the location of the Common Files directory.
CommonProgramFiles(x86) Returns the location of the Common Files directory for 32-bit applications on Windows 64-bit.
CommonProgramW6432 Returns the location of the Common Files directory for 64-bit applications on Windows 64-bit, if running a 32-bit application.
DATE System returns the current date. This variable uses the same format as the date /t command. Cmd.exe generates this variable. For more information about the date command, see the Date command.
ERRORLEVEL System returns the error code of the most recently used command. A non-0 value usually indicates an error.
HOMEDRIVE System returns which local workstation drive letter is connected to the user's home directory. This variable is set based on the value of the home directory. The user's home directory is specified in Local Users and Groups.
HOMEPATH System returns the full path of the user's home directory. This variable is set based on the value of the home directory. The user's home directory is specified in Local Users and Groups.
HOMESHARE System returns the network path to the user's shared home directory. This variable is set based on the value of the home directory. The user's home directory is specified in Local Users and Groups.
LOGONSERVER Local returns the name of the domain controller that validated the current logon session.
NUMBER_OF_PROCESSORS System specifies the number of processors installed on the computer.
OS System returns the OS name. Windows XP and Windows 2000 display the OS as Windows_NT.
PATH System specifies the search path for executable files.
PATHEXT System returns a list of the file extensions that the OS considers to be executable.
PROCESSOR_ARCHITECTURE System returns the processor's chip architecture. Values: x86, IA64, AMD64.
PROCESSOR_ARCHITEW6432 System returns the processor's chip architecture, if running a 32-bit application on Windows 64-bit. Values: IA64, AMD64.
PROCESSOR_IDENTFIER System returns a description of the processor.
PROCESSOR_LEVEL System returns the model number of the computer's processor.
PROCESSOR_REVISION System returns the revision number of the processor.
PROGRAMFILES Returns the location of the Program Files directory.
PROGRAMFILES(x86) Returns the location of the Program Files directory for 32-bit applications on Windows 64-bit.
PROGRAMW6432 Returns the location of the Program Files directory for 64-bit applications on Windows 64-bit, if running a 32-bit application.
PROMPT Local returns the command-prompt settings for the current interpreter. Cmd.exe generates this variable.
RANDOM System returns a random decimal number between 0 and 32767. Cmd.exe generates this variable.
SYSTEMDRIVE System returns the drive containing the Windows root directory (i.e., the system root).
SYSTEMROOT System returns the location of the Windows root directory.
TEMP or TMP System and User return the default temporary directories for applications that are available to users who are currently logged on. Some applications require TEMP and others require TMP.
TIME System returns the current time. This variable uses the same format as the time /t command. Cmd.exe generates this variable. For more information about the time command, see the Time command.
USERDOMAIN Local returns the name of the domain that contains the user's account.
USERNAME Local returns the name of the user currently logged on.
USERPROFILE Local returns the location of the profile for the current user.
WINDIR System returns the location of the OS directory.