Skip to content

Instantly share code, notes, and snippets.

@nanpingxiang
Forked from pkfrom/List_of_ENV_in_Windows.md
Created January 10, 2021 02:34
Show Gist options
  • Select an option

  • Save nanpingxiang/2365c9eb81e20eba47f3f2ddc5c33857 to your computer and use it in GitHub Desktop.

Select an option

Save nanpingxiang/2365c9eb81e20eba47f3f2ddc5c33857 to your computer and use it in GitHub Desktop.
List of Environment Variables in Windows Operating System.

List of Environment Variables in Windows Operating System

Windows XP Environment Variables

Environment Variable Path
%ALLUSERSPROFILE% C:\Documents and Settings\All Users
%APPDATA% C:\Documents and Settings{username}\Application Data
%COMMONPROGRAMFILES% C:\Program Files\Common Files
%COMMONPROGRAMFILES(x86)% C:\Program Files (x86)\Common Files
%COMSPEC% C:\Windows\System32\cmd.exe
%HOMEDRIVE% C:
%HOMEPATH% C:\Documents and Settings{username}
%PROGRAMFILES% C:\Program Files
%PROGRAMFILES(X86)% C:\Program Files (x86) (only in 64-bit version)
%SystemDrive% C:
%SystemRoot% C:\Windows
%TEMP% and %TMP% C:\Documents and Settings{username}\Local Settings\Temp
%USERPROFILE% C:\Documents and Settings{username}
%WINDIR% C:\Windows

Windows Vista and Later

Environment Variable Path
%ALLUSERSPROFILE% C:\ProgramData
%APPDATA% C:\Users{username}\AppData\Roaming
%COMMONPROGRAMFILES% C:\Program Files\Common Files
%COMMONPROGRAMFILES(x86)% C:\Program Files (x86)\Common Files
%COMSPEC% C:\Windows\System32\cmd.exe
%HOMEDRIVE% C:
%HOMEPATH% C:\Users{username}
%LOCALAPPDATA% C:\Users{username}\AppData\Local
%PROGRAMDATA% C:\ProgramData
%PROGRAMFILES% C:\Program Files
%PROGRAMFILES(X86)% C:\Program Files (x86) (only in 64-bit version)
%PUBLIC% C:\Users\Public
%SystemDrive% C:
%SystemRoot% C:\Windows
%TEMP% and %TMP% C:\Users{username}\AppData\Local\Temp
%USERPROFILE% C:\Users{username}
%WINDIR% C:\Windows
%SystemDirectory% C:\WINDOWS\System32

More

Environment Variable Detail
%CD% The current directory.
%ERRORLEVEL% A number defining exit status of a previous command or called executable.
%OS% The operating system the user is running
%USERDOMAIN% The name of the domain that contains the user's account
%USERNAME% The user's name
%DATE% Current date in the format
%TIME% Current time in the format
%RANDOM% A random number between 0 and 32767.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment