General Complete List of Environment Variables in Windows 11


  • Staff
Environment_Variables_banner.png

This tutorial will show you a complete list of default environment variables that can be used to reference standard directories and parameters in Windows 10 and Windows 11.

Environment variables are a set of dynamic named values that can affect the way running processes will behave on a computer. The variables can be used both in scripts and on the command line. Environment variables makes it easy when certain standard directories and parameters need to be referenced but where the actual locations or names can vary from computer to computer.

The variable (ex: "%UserProfile%" for command and "$Env:UserProfile" for PowerShell) is used as a type of shortcut of the value (ex: "C:\Users\<username>").

There are two types of environment variables: user environment variables (set only for current user) and system environment variables (set for all users).


User environment variables are stored in the registry key below:

HKEY_CURRENT_USER\Environment

System environment variables are stored in the registry key below:

HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\Session Manager\Environment

You can open a command prompt, type set, and press Enter to display all current environment variables on your PC.

You can open PowerShell, type Get-ChildItem Env:, and press Enter to display all current environment variables on your PC.




Command
Environment Variables​
PowerShell
Environment Variables​
Values​
%ALLUSERSPROFILE%$Env:ALLUSERSPROFILEC:\ProgramData
%APPDATA%$Env:APPDATAC:\Users\(user-name)\AppData\Roaming
%CD%$Env:CDCurrent directory full path
%CMDCMDLINE%Returns exact command line used to start current cmd.exe session.
%CMDEXTVERSION%Number of current command processor extensions.
%CommonProgramFiles%$Env:CommonProgramFilesC:\Program Files\Common Files
%CommonProgramFiles(x86)%$Env:CommonProgramFiles(x86)C:\Program Files (x86)\Common Files
%CommonProgramW6432%$Env:CommonProgramW6432C:\Program Files\Common Files
%COMPUTERNAME%$Env:COMPUTERNAMEThe computer name of the current local system.
%ComSpec%$Env:ComSpecC:\Windows\System32\cmd.exe
%DATE%Current date in format determined by Date command
%DriverData%$Env:DriverDataC:\Windows\System32\Drivers\DriverData
%ERRORLEVEL%Number defining exit status of previous command or program
%HOMEDRIVE%$Env:HOMEDRIVEC:
%HOMEPATH%$Env:HOMEPATH\Users\(user-name)
%LOCALAPPDATA%$Env:LOCALAPPDATAC:\Users\(user-name)\AppData\Local
%LOGONSERVER%$Env:LOGONSERVER\\MicrosoftAccount
%NUMBER_OF_PROCESSORS%$Env:NUMBER_OF_PROCESSORS12
%OneDrive%$Env:OneDriveCurrent OneDrive folder location
%OS%$Env:OSWindows_NT
%Path%$Env:pathC:\WINDOWS
C:\WINDOWS\system32
C:\WINDOWS\System32\Wbem
C:\WINDOWS\System32\WindowsPowerShell\v1.0
%PATHEXT%$Env:pATHEXTCOM;.EXE;.BAT;.CMD;.VBS;.VBE;.JS;.JSE;.WSF;.WSH;.MSC
%PROCESSOR_ARCHITECTURE%$Env:pROCESSOR_ARCHITECTUREAMD64
%PROCESSOR_IDENTIFIER%$Env:pROCESSOR_IDENTIFIERIntel64 Family 6 Model 158 Stepping 10, GenuineIntel
%PROCESSOR_LEVEL%$Env:pROCESSOR_LEVEL6
%PROCESSOR_REVISION%$Env:pROCESSOR_REVISION9e0a
%ProgramData%$Env:programDataC:\ProgramData
%ProgramFiles%$Env:programFilesC:\Program Files
%ProgramFiles(x86)%$Env:programFiles(x86)C:\Program Files (x86)
%ProgramW6432%$Env:programW6432C:\Program Files
%PROMPT%Code for current command prompt format. Code is usually $P$G
%PSModulePath%$Env:pSModulePathC:\Windows\system32\WindowsPowerShell\v1.0\Modules\
%PUBLIC%$Env:pUBLICC:\Users\Public
%RANDOM%Get random number between 0 and 32767
%SESSIONNAME%$Env:SESSIONNAMEWhen logging on directly to machine, returns "Console".

When client connects via terminal server session, is combination of
connection name, followed by pound symbol {#} and session number.
%SystemDrive%$Env:SystemDriveC:
%SystemRoot%$Env:SystemRootC:\Windows
%TEMP%$Env:TEMPC:\Users\(user-name)\AppData\Local\Temp
%TIME%Current time in format determined by Time command
%TMP%$Env:TMPC:\Users\(user-name)\AppData\Local\Temp
%USERDOMAIN%$Env:USERDOMAINNetwork domain name associated with the current user.
%USERDOMAIN_ROAMINGPROFILE%$Env:USERDOMAIN_ROAMINGPROFILENetwork domain name associated with the current roaming profile.
%USERNAME%$Env:USERNAME(user-name)
%USERPROFILE%$Env:USERPROFILEC:\Users\(user-name)
%WINDIR%$Env:WINDIRC:\Windows


That's it,
Shawn Brink


 

Attachments

  • Environment_Variables.png
    Environment_Variables.png
    1.6 KB · Views: 59
Last edited:
Hi Brink,

If I am missing several of these Environmental Variables from your list above, is there any advantage to manually adding them?

Also, should I be on the lookup for obsolete Environmental Variables that should be deleted?

Thanks,

GWD
 

My Computer

System One

  • OS
    Windows 11 Pro for Workstations
    Computer type
    PC/Desktop
    Manufacturer/Model
    Alienware
    CPU
    Intel(R) Core (TM) i7-9700 CPU @ 3.00 GHz
    Memory
    32 GB
    Graphics Card(s)
    NVIDIA GeForce RTX 2060
How did you list them?
Which ones are missing?

Denis
 

My Computer

System One

  • OS
    Windows 11 Home x64 Version 23H2 Build 22631.3296
Hi Brink,

If I am missing several of these Environmental Variables from your list above, is there any advantage to manually adding them?

Also, should I be on the lookup for obsolete Environmental Variables that should be deleted?

Thanks,

GWD
Hello GWD, and welcome. :alien:

You can check using one of the commands at the top to see which variables you currently have.

Which ones are you missing?
 

My Computers

System One System Two

  • OS
    Windows 11 Pro for Workstations
    Computer type
    PC/Desktop
    Manufacturer/Model
    Custom self build
    CPU
    Intel i7-8700K 5 GHz
    Motherboard
    ASUS ROG Maximus XI Formula Z390
    Memory
    64 GB (4x16GB) G.SKILL TridentZ RGB DDR4 3600 MHz (F4-3600C18D-32GTZR)
    Graphics Card(s)
    ASUS ROG-STRIX-GTX1080TI-O11G-GAMING (11GB GDDR5X)
    Sound Card
    Integrated Digital Audio (S/PDIF)
    Monitor(s) Displays
    2 x Samsung Odyssey G75 27"
    Screen Resolution
    2560x1440
    Hard Drives
    1TB Samsung 990 PRO M.2,
    4TB Samsung 990 PRO M.2,
    8TB WD MyCloudEX2Ultra NAS
    PSU
    Seasonic Prime Titanium 850W
    Case
    Thermaltake Core P3 wall mounted
    Cooling
    Corsair Hydro H115i
    Keyboard
    Logitech wireless K800
    Mouse
    Logitech MX Master 3
    Internet Speed
    1 Gbps Download and 35 Mbps Upload
    Browser
    Google Chrome
    Antivirus
    Microsoft Defender and Malwarebytes Premium
    Other Info
    Logitech Z625 speaker system,
    Logitech BRIO 4K Pro webcam,
    HP Color LaserJet Pro MFP M477fdn,
    APC SMART-UPS RT 1000 XL - SURT1000XLI,
    Galaxy S23 Plus phone
  • Operating System
    Windows 11 Pro
    Computer type
    Laptop
    Manufacturer/Model
    HP Spectre x360 2in1 14-eu0098nr (2024)
    CPU
    Intel Core Ultra 7 155H 4.8 GHz
    Memory
    16 GB LPDDR5x-7467 MHz
    Graphics card(s)
    Integrated Intel Arc
    Sound Card
    Poly Studio
    Monitor(s) Displays
    14" 2.8K OLED multitouch
    Screen Resolution
    2880 x 1800
    Hard Drives
    2 TB PCIe NVMe M.2 SSD
    Internet Speed
    Intel Wi-Fi 7 BE200 (2x2) and Bluetooth 5.4
    Browser
    Chrome and Edge
    Antivirus
    Windows Defender and Malwarebytes Premium
I have a cmd file in which %USERPROFILE% works in win10 32bit but not in win11 64bit but fixed it with using %HOMEPATH% I didn't think it should make a difference.
 

My Computer

System One

  • OS
    Windows 11 PRO, 22H2
    CPU
    Intel(R) Core(TM) i5-10500 CPU @ 3.10GHz 3.10 GHz
    Motherboard
    ASUS PRIME B460M-A
    Memory
    16.0 GB
    Monitor(s) Displays
    2 X Acer B243HL
    Hard Drives
    Samsung SSD 970 EVO Plus 500GB + 2 SATA X 1TB
Is there no Environment Variable for?: C:\Users\Default\AppData
 

My Computers

System One System Two

  • OS
    Windows 11 Pro
    Computer type
    PC/Desktop
    Manufacturer/Model
    Stigg's Build
    CPU
    Intel Core i9-10900X
    Motherboard
    GIGABYTE X299X DESIGNARE 10G
    Memory
    Corsair 64 GB (4 x 16 GB) CMW64GX4M4C3000C15 Vengeance RGB Pro 3000Mhz DDR4
    Graphics Card(s)
    GIGABYTE GeForce GTX 1660 Super Mini ITX 6 GB OC
    Sound Card
    Realtek ALC1220
    Monitor(s) Displays
    Samsung 27" FHD LED FreeSync Gaming Monitor (LS27F350FHEXXY)
    Screen Resolution
    1920 x 1080
    Hard Drives
    Samsung 970 Pro Series 1TB M.2 2280 NVMe SSD
    Western Digital Red Pro WD8003FFBX-68B9AN0 8 TB, 7200 RPM, SATA-III
    Western Digital Red Pro WD8003FFBX-68B9AN0 8 TB, 7200 RPM, SATA-III
    PSU
    Corsair HX1200 1200W 80 Plus Platinum
    Case
    Fractal Design Define 7 Black Solid Case
    Cooling
    Noctua NH-D15 Chromax Black
    Keyboard
    Razer Ornata V2
    Mouse
    Razer DeathAdder Essential
    Internet Speed
    FTTN 100Mbps / 40Mbps
    Browser
    Mozilla Firefox
    Antivirus
    N/A
    Other Info
    Logitech BRIO 4k Ultra HD USB-C Webcam
  • Operating System
    Windows 10 Pro
    Computer type
    Laptop
    Manufacturer/Model
    ASUS ROG Zephyrus M GM501GS
    CPU
    Core i7-8750H
    Motherboard
    Zephyrus M GM501GS
    Memory
    SK Hynix 32 GB (2 x 16 GB) HMA82GS6CJR8N-VK 16 GB DDR4-2666 DDR4 SDRAM
    Graphics card(s)
    NVIDIA GeForce GTX 1070
    Sound Card
    Realtek ALC294
    Monitor(s) Displays
    AU Optronics B156HAN07.1 [15.6" LCD]
    Screen Resolution
    1920 x 1080
    Hard Drives
    Samsung MZVKW512HMJP-00000 512 GB, PCI-E 3.0 x4
    Samsung SSD 860 QVO 4TB 4 TB, SATA-III
    PSU
    N/A
    Case
    N/A
    Cooling
    N/A
    Mouse
    Razer DeathAdder Essential
    Keyboard
    PC/AT Enhanced PS2 Keyboard (101/102-Key)
    Internet Speed
    FTTN 100Mbps / 40Mbps
    Browser
    Mozilla Firefox
    Antivirus
    N/A
    Other Info
    USB2.0 HD UVC Webcam
I have a cmd file in which %USERPROFILE% works in win10 32bit but not in win11 64bit but fixed it with using %HOMEPATH% I didn't think it should make a difference.
I am also surprised.
What does %USERPROFILE% return for you in those two OSes?

Denis
 

My Computer

System One

  • OS
    Windows 11 Home x64 Version 23H2 Build 22631.3296
ERROR in win11 (using robocopy) but works perfectly in win10 32
%HOMEPATH% works perfectly in win11 64 & win10 32

same problem with xcopy
 

My Computer

System One

  • OS
    Windows 11 PRO, 22H2
    CPU
    Intel(R) Core(TM) i5-10500 CPU @ 3.10GHz 3.10 GHz
    Motherboard
    ASUS PRIME B460M-A
    Memory
    16.0 GB
    Monitor(s) Displays
    2 X Acer B243HL
    Hard Drives
    Samsung SSD 970 EVO Plus 500GB + 2 SATA X 1TB
What is the environment variable for:
C:\Users\{username}\AppData\LocalLow
There isn't one.
You'd have to use something like
%UserProfile%\AppData\LocalLow

Denis
 

My Computer

System One

  • OS
    Windows 11 Home x64 Version 23H2 Build 22631.3296

Latest Support Threads

Back
Top Bottom