General Complete List of Environment Variables in Windows 11


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


 
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 25H2 Build 26200.8037
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,
    TerraMaster F8 SSD Plus NAS
    PSU
    Seasonic Prime Titanium 850W
    Case
    Thermaltake Core P3 wall mounted
    Cooling
    Corsair Hydro H115i
    Keyboard
    Amazon Basics Wired Full Keyboard MD005
    Mouse
    Logitech MX Master 4
    Internet Speed
    2 Gbps Download and 100 Mbps Upload
    Browser
    Chrome and Edge
    Antivirus
    Microsoft Defender
    Other Info
    Logitech Z625 speaker system,
    Logitech BRIO 4K Pro webcam,
    HP Color LaserJet Pro MFP M477fdn,
    CyberPower CP1500PFCLCD
    Galaxy S23 Plus phone
  • Operating System
    Windows 11 Pro
    Computer type
    Laptop
    Manufacturer/Model
    Surface Laptop 7 Copilot+ PC
    CPU
    Snapdragon X Elite (12 core) 3.42 GHz
    Memory
    16 GB LPDDR5x-7467 MHz
    Monitor(s) Displays
    15" HDR
    Screen Resolution
    2496 x 1664
    Hard Drives
    1 TB SSD
    Internet Speed
    Wi-Fi 7 and Bluetooth 5.4
    Browser
    Chrome and Edge
    Antivirus
    Microsoft Defender
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
    Keyboard
    PC/AT Enhanced PS2 Keyboard (101/102-Key)
    Mouse
    Razer DeathAdder Essential
    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 25H2 Build 26200.8037
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 25H2 Build 26200.8037
May I bother you to ask for one of your awesome "One click" registery addition files which reverts the default environment variables for Windows 11? I was hoping to find one in this tutorial. Your reg edit files are a life saver. If not, I tottaly understand and appriciate your time and effort for everything you've put together for this awesome site.
 

My Computer

System One

  • OS
    Microsoft Windows 11 Pro 10.0.26100 Build 26100
    Computer type
    PC/Desktop
    Manufacturer/Model
    LENOVO 90T00003US (IdeaCentre Gaming 5 17IAB7)
    CPU
    12th Gen Intel(R) Core(TM) i7-12700 Clocked at 4.59 GHz
    Motherboard
    LENOVO SDK0T76461 WIN 3422111214830
    Memory
    Ramaxel Technology 16.0 GB DDR4
    Graphics Card(s)
    Nvidia GeForce RTX 3060 12GB
    Monitor(s) Displays
    LG Ultragear
    Screen Resolution
    2560x1440 180Hz
May I bother you to ask for one of your awesome "One click" registery addition files which reverts the default environment variables for Windows 11? I was hoping to find one in this tutorial. Your reg edit files are a life saver. If not, I tottaly understand and appriciate your time and effort for everything you've put together for this awesome site.

Hello, :alien:

Some of these are system specific, so that's the main reason there's not a REG file to restore default environmental variables. The REG below is for the generic system variables to help for now.

Was there something specific you needed?
 

Attachments

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,
    TerraMaster F8 SSD Plus NAS
    PSU
    Seasonic Prime Titanium 850W
    Case
    Thermaltake Core P3 wall mounted
    Cooling
    Corsair Hydro H115i
    Keyboard
    Amazon Basics Wired Full Keyboard MD005
    Mouse
    Logitech MX Master 4
    Internet Speed
    2 Gbps Download and 100 Mbps Upload
    Browser
    Chrome and Edge
    Antivirus
    Microsoft Defender
    Other Info
    Logitech Z625 speaker system,
    Logitech BRIO 4K Pro webcam,
    HP Color LaserJet Pro MFP M477fdn,
    CyberPower CP1500PFCLCD
    Galaxy S23 Plus phone
  • Operating System
    Windows 11 Pro
    Computer type
    Laptop
    Manufacturer/Model
    Surface Laptop 7 Copilot+ PC
    CPU
    Snapdragon X Elite (12 core) 3.42 GHz
    Memory
    16 GB LPDDR5x-7467 MHz
    Monitor(s) Displays
    15" HDR
    Screen Resolution
    2496 x 1664
    Hard Drives
    1 TB SSD
    Internet Speed
    Wi-Fi 7 and Bluetooth 5.4
    Browser
    Chrome and Edge
    Antivirus
    Microsoft Defender
For the most part, you don't need to reset Environment Variables to a "default value".

The majority of the listed variables are dynamic, they only appear within the current CMD or PowerShell session you're in. After you terminate the current window, any new session won't inherit the previous changes made in the last session. They are not persistent (with an exception we'll get to later).

Environmental variables can be grouped by category:

1. Machine scope variables are provided at a SYSTEM level, and are shared with all users and running processes.

Code:
PS C:\Users\GARLIN> [System.Environment]::GetEnvironmentVariables([System.EnvironmentVariableTarget]::Machine).GetEnumerator() | Sort-Object Name

Name                           Value                                                                                                                                                                                                                                                                                                                                                                                                                    
----                           -----                                                                                                                                                                                                                                                                                                                                                                                                                    
ComSpec                        C:\WINDOWS\system32\cmd.exe                                                                                                                                                                                                                                                                                                                                                                                              
DriverData                     C:\Windows\System32\Drivers\DriverData                                                                                                                                                                                                                                                                                                                                                                                   
NUMBER_OF_PROCESSORS           2                                                                                                                                                                                                                                                                                                                                                                                                                        
OS                             Windows_NT                                                                                                                                                                                                                                                                                                                                                                                                               
Path                           C:\WINDOWS\system32;C:\WINDOWS;C:\WINDOWS\System32\Wbem;C:\WINDOWS\System32\WindowsPowerShell\v1.0\;C:\WINDOWS\System32\OpenSSH\                                                                                                                                                                                                                                                                                         
PATHEXT                        .COM;.EXE;.BAT;.CMD;.VBS;.VBE;.JS;.JSE;.WSF;.WSH;.MSC                                                                                                                                                                                                                                                                                                                                                                    
PROCESSOR_ARCHITECTURE         AMD64                                                                                                                                                                                                                                                                                                                                                                                                                    
PROCESSOR_IDENTIFIER           Intel64 Family 6 Model 60 Stepping 3, GenuineIntel                                                                                                                                                                                                                                                                                                                                                                       
PROCESSOR_LEVEL                6                                                                                                                                                                                                                                                                                                                                                                                                                        
PROCESSOR_REVISION             3c03                                                                                                                                                                                                                                                                                                                                                                                                                     
PSModulePath                   C:\Program Files (x86)\WindowsPowerShell\Modules;C:\WINDOWS\system32\WindowsPowerShell\v1.0\Modules                                                                                                                                                                                                                                                                                                                      
TEMP                           C:\WINDOWS\TEMP                                                                                                                                                                                                                                                                                                                                                                                                          
TMP                            C:\WINDOWS\TEMP                                                                                                                                                                                                                                                                                                                                                                                                          
USERNAME                       SYSTEM                                                                                                                                                                                                                                                                                                                                                                                                                   
windir                         C:\WINDOWS

The processor values are collected at boot time and inserted into the Registry. If you change their values, they will be overwritten when Windows restarts the system. When running under a different user ID, USERNAME will be replaced by that identity.

2. User scope variables are provided for your user profile, and are persistent.

Code:
PS C:\Users\GARLIN> [System.Environment]::GetEnvironmentVariables([System.EnvironmentVariableTarget]::User).GetEnumerator() | Sort-Object Name

Name                           Value                                                                                                                                                                                                                                                                                                                                                                                                                    
----                           -----                                                                                                                                                                                                                                                                                                                                                                                                                    
OneDrive                       C:\Users\GARLIN\OneDrive                                                                                                                                                                                                                                                                                                                                                                                                 
Path                           C:\Users\GARLIN\AppData\Local\Microsoft\WindowsApps;                                                                                                                                                                                                                                                                                                                                                                     
TEMP                           C:\Users\GARLIN\AppData\Local\Temp                                                                                                                                                                                                                                                                                                                                                                                       
TMP                            C:\Users\GARLIN\AppData\Local\Temp

3. Process scope variables are provided while you're running inside CMD or PowerShell. This is a combination of the Machine scope, User scope and whatever extra variables your shell provides for you.

Code:
PS C:\Users\GARLIN> [System.Environment]::GetEnvironmentVariables([System.EnvironmentVariableTarget]::Process).GetEnumerator() | Sort-Object Name

Name                           Value                                                                                                                                                                                                                                                                                                                                                                                                                    
----                           -----                                                                                                                                                                                                                                                                                                                                                                                                                    
ALLUSERSPROFILE                C:\ProgramData                                                                                                                                                                                                                                                                                                                                                                                                           
APPDATA                        C:\Users\GARLIN\AppData\Roaming                                                                                                                                                                                                                                                                                                                                                                                          
CommonProgramFiles             C:\Program Files (x86)\Common Files                                                                                                                                                                                                                                                                                                                                                                                      
CommonProgramFiles(x86)        C:\Program Files (x86)\Common Files                                                                                                                                                                                                                                                                                                                                                                                      
CommonProgramW6432             C:\Program Files\Common Files                                                                                                                                                                                                                                                                                                                                                                                            
COMPUTERNAME                   Y50-70                                                                                                                                                                                                                                                                                                                                                                                                                   
ComSpec                        C:\WINDOWS\system32\cmd.exe                                                                                                                                                                                                                                                                                                                                                                                              
DriverData                     C:\Windows\System32\Drivers\DriverData                                                                                                                                                                                                                                                                                                                                                                                   
FPS_BROWSER_APP_PROFILE_STRING Internet Explorer                                                                                                                                                                                                                                                                                                                                                                                                        
FPS_BROWSER_USER_PROFILE_ST... Default                                                                                                                                                                                                                                                                                                                                                                                                                  
HOMEDRIVE                      C:                                                                                                                                                                                                                                                                                                                                                                                                                       
HOMEPATH                       \Users\GARLIN                                                                                                                                                                                                                                                                                                                                                                                                            
LOCALAPPDATA                   C:\Users\GARLIN\AppData\Local                                                                                                                                                                                                                                                                                                                                                                                            
LOGONSERVER                    \\Y50-70                                                                                                                                                                                                                                                                                                                                                                                                                 
NUMBER_OF_PROCESSORS           2                                                                                                                                                                                                                                                                                                                                                                                                                        
OneDrive                       C:\Users\GARLIN\OneDrive                                                                                                                                                                                                                                                                                                                                                                                                 
OS                             Windows_NT                                                                                                                                                                                                                                                                                                                                                                                                               
Path                           C:\WINDOWS\system32;C:\WINDOWS;C:\WINDOWS\System32\Wbem;C:\WINDOWS\System32\WindowsPowerShell\v1.0\;C:\WINDOWS\System32\OpenSSH\;C:\Users\GARLIN\AppData\Local\Microsoft\WindowsApps                                                                                                                                                                                                                                     
PATHEXT                        .COM;.EXE;.BAT;.CMD;.VBS;.VBE;.JS;.JSE;.WSF;.WSH;.MSC;.CPL                                                                                                                                                                                                                                                                                                                                                               
PROCESSOR_ARCHITECTURE         x86                                                                                                                                                                                                                                                                                                                                                                                                                      
PROCESSOR_ARCHITEW6432         AMD64                                                                                                                                                                                                                                                                                                                                                                                                                    
PROCESSOR_IDENTIFIER           Intel64 Family 6 Model 60 Stepping 3, GenuineIntel                                                                                                                                                                                                                                                                                                                                                                       
PROCESSOR_LEVEL                6                                                                                                                                                                                                                                                                                                                                                                                                                        
PROCESSOR_REVISION             3c03                                                                                                                                                                                                                                                                                                                                                                                                                     
ProgramData                    C:\ProgramData                                                                                                                                                                                                                                                                                                                                                                                                           
ProgramFiles                   C:\Program Files (x86)                                                                                                                                                                                                                                                                                                                                                                                                   
ProgramFiles(x86)              C:\Program Files (x86)                                                                                                                                                                                                                                                                                                                                                                                                   
ProgramW6432                   C:\Program Files                                                                                                                                                                                                                                                                                                                                                                                                         
PSModulePath                   C:\Program Files\WindowsPowerShell\Modules;C:\Users\GARLIN\Documents\WindowsPowerShell\Modules;C:\Program Files (x86)\WindowsPowerShell\Modules;C:\WINDOWS\system32\WindowsPowerShell\v1.0\Modules                                                                                                                                                                                                                       
PUBLIC                         C:\Users\Public                                                                                                                                                                                                                                                                                                                                                                                                          
SystemDrive                    C:                                                                                                                                                                                                                                                                                                                                                                                                                       
SystemRoot                     C:\WINDOWS                                                                                                                                                                                                                                                                                                                                                                                                               
TEMP                           C:\Users\GARLIN\AppData\Local\Temp                                                                                                                                                                                                                                                                                                                                                                                       
TMP                            C:\Users\GARLIN\AppData\Local\Temp                                                                                                                                                                                                                                                                                                                                                                                       
USERDOMAIN                     Y50-70                                                                                                                                                                                                                                                                                                                                                                                                                   
USERDOMAIN_ROAMINGPROFILE      Y50-70                                                                                                                                                                                                                                                                                                                                                                                                                   
USERNAME                       GARLIN                                                                                                                                                                                                                                                                                                                                                                                                                   
USERPROFILE                    C:\Users\GARLIN                                                                                                                                                                                                                                                                                                                                                                                                          
windir                         C:\WINDOWS

4. New environment variables can be added persistently, by using:
- Advanced System Settings / Environment Variables
- "setx" or "setx /m" commands from CMD
- [System.Environment]::SetEnvironmentVariable() from PowerShell

If you mess up environment variables, the only ones to really care about are in Machine scope & User scope. Some of your apps will create their own variables under Machine or User, but you will have to find out what those defaults on your own. They will vary by specific app.
 

My Computer

System One

  • OS
    Windows 7
Hello, :alien:

Some of these are system specific, so that's the main reason there's not a REG file to restore default environmental variables. The REG below is for the generic system variables to help for now.

Was there something specific you needed?
Please leave me with your "buy me a coffee" link because your work is nothing short of god sent. How Microsoft hasn't hired you yet is beyond my comprehension. You're awesome!!

Please reply with the link so I can try to show the gratitude and appreciation for all of the hard work and dedication which you have put into running this site and even replying to users and providing them with a custom reg files like this (which is UNHEARD of in all of my past experience with anything related to Microsoft/Windows LOL)

Nothing short of excellence personified. THANK YOU AGAIN!!! 🤍🤍🤍🤍🤍
 

My Computer

System One

  • OS
    Microsoft Windows 11 Pro 10.0.26100 Build 26100
    Computer type
    PC/Desktop
    Manufacturer/Model
    LENOVO 90T00003US (IdeaCentre Gaming 5 17IAB7)
    CPU
    12th Gen Intel(R) Core(TM) i7-12700 Clocked at 4.59 GHz
    Motherboard
    LENOVO SDK0T76461 WIN 3422111214830
    Memory
    Ramaxel Technology 16.0 GB DDR4
    Graphics Card(s)
    Nvidia GeForce RTX 3060 12GB
    Monitor(s) Displays
    LG Ultragear
    Screen Resolution
    2560x1440 180Hz
Please leave me with your "buy me a coffee" link because your work is nothing short of god sent. How Microsoft hasn't hired you yet is beyond my comprehension. You're awesome!!

Please reply with the link so I can try to show the gratitude and appreciation for all of the hard work and dedication which you have put into running this site and even replying to users and providing them with a custom reg files like this (which is UNHEARD of in all of my past experience with anything related to Microsoft/Windows LOL)

Nothing short of excellence personified. THANK YOU AGAIN!!! 🤍🤍🤍🤍🤍

Glad it could help. :coffee:
 

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,
    TerraMaster F8 SSD Plus NAS
    PSU
    Seasonic Prime Titanium 850W
    Case
    Thermaltake Core P3 wall mounted
    Cooling
    Corsair Hydro H115i
    Keyboard
    Amazon Basics Wired Full Keyboard MD005
    Mouse
    Logitech MX Master 4
    Internet Speed
    2 Gbps Download and 100 Mbps Upload
    Browser
    Chrome and Edge
    Antivirus
    Microsoft Defender
    Other Info
    Logitech Z625 speaker system,
    Logitech BRIO 4K Pro webcam,
    HP Color LaserJet Pro MFP M477fdn,
    CyberPower CP1500PFCLCD
    Galaxy S23 Plus phone
  • Operating System
    Windows 11 Pro
    Computer type
    Laptop
    Manufacturer/Model
    Surface Laptop 7 Copilot+ PC
    CPU
    Snapdragon X Elite (12 core) 3.42 GHz
    Memory
    16 GB LPDDR5x-7467 MHz
    Monitor(s) Displays
    15" HDR
    Screen Resolution
    2496 x 1664
    Hard Drives
    1 TB SSD
    Internet Speed
    Wi-Fi 7 and Bluetooth 5.4
    Browser
    Chrome and Edge
    Antivirus
    Microsoft Defender
For the most part, you don't need to reset Environment Variables to a "default value".

The majority of the listed variables are dynamic, they only appear within the current CMD or PowerShell session you're in. After you terminate the current window, any new session won't inherit the previous changes made in the last session. They are not persistent (with an exception we'll get to later).

Environmental variables can be grouped by category:

1. Machine scope variables are provided at a SYSTEM level, and are shared with all users and running processes.

Code:
PS C:\Users\GARLIN> [System.Environment]::GetEnvironmentVariables([System.EnvironmentVariableTarget]::Machine).GetEnumerator() | Sort-Object Name

Name                           Value                                                                                                                                                                                                                                                                                                                                                                                                                   
----                           -----                                                                                                                                                                                                                                                                                                                                                                                                                   
ComSpec                        C:\WINDOWS\system32\cmd.exe                                                                                                                                                                                                                                                                                                                                                                                             
DriverData                     C:\Windows\System32\Drivers\DriverData                                                                                                                                                                                                                                                                                                                                                                                  
NUMBER_OF_PROCESSORS           2                                                                                                                                                                                                                                                                                                                                                                                                                       
OS                             Windows_NT                                                                                                                                                                                                                                                                                                                                                                                                              
Path                           C:\WINDOWS\system32;C:\WINDOWS;C:\WINDOWS\System32\Wbem;C:\WINDOWS\System32\WindowsPowerShell\v1.0\;C:\WINDOWS\System32\OpenSSH\                                                                                                                                                                                                                                                                                        
PATHEXT                        .COM;.EXE;.BAT;.CMD;.VBS;.VBE;.JS;.JSE;.WSF;.WSH;.MSC                                                                                                                                                                                                                                                                                                                                                                   
PROCESSOR_ARCHITECTURE         AMD64                                                                                                                                                                                                                                                                                                                                                                                                                   
PROCESSOR_IDENTIFIER           Intel64 Family 6 Model 60 Stepping 3, GenuineIntel                                                                                                                                                                                                                                                                                                                                                                      
PROCESSOR_LEVEL                6                                                                                                                                                                                                                                                                                                                                                                                                                       
PROCESSOR_REVISION             3c03                                                                                                                                                                                                                                                                                                                                                                                                                    
PSModulePath                   C:\Program Files (x86)\WindowsPowerShell\Modules;C:\WINDOWS\system32\WindowsPowerShell\v1.0\Modules                                                                                                                                                                                                                                                                                                                     
TEMP                           C:\WINDOWS\TEMP                                                                                                                                                                                                                                                                                                                                                                                                         
TMP                            C:\WINDOWS\TEMP                                                                                                                                                                                                                                                                                                                                                                                                         
USERNAME                       SYSTEM                                                                                                                                                                                                                                                                                                                                                                                                                  
windir                         C:\WINDOWS

The processor values are collected at boot time and inserted into the Registry. If you change their values, they will be overwritten when Windows restarts the system. When running under a different user ID, USERNAME will be replaced by that identity.

2. User scope variables are provided for your user profile, and are persistent.

Code:
PS C:\Users\GARLIN> [System.Environment]::GetEnvironmentVariables([System.EnvironmentVariableTarget]::User).GetEnumerator() | Sort-Object Name

Name                           Value                                                                                                                                                                                                                                                                                                                                                                                                                   
----                           -----                                                                                                                                                                                                                                                                                                                                                                                                                   
OneDrive                       C:\Users\GARLIN\OneDrive                                                                                                                                                                                                                                                                                                                                                                                                
Path                           C:\Users\GARLIN\AppData\Local\Microsoft\WindowsApps;                                                                                                                                                                                                                                                                                                                                                                    
TEMP                           C:\Users\GARLIN\AppData\Local\Temp                                                                                                                                                                                                                                                                                                                                                                                      
TMP                            C:\Users\GARLIN\AppData\Local\Temp

3. Process scope variables are provided while you're running inside CMD or PowerShell. This is a combination of the Machine scope, User scope and whatever extra variables your shell provides for you.

Code:
PS C:\Users\GARLIN> [System.Environment]::GetEnvironmentVariables([System.EnvironmentVariableTarget]::Process).GetEnumerator() | Sort-Object Name

Name                           Value                                                                                                                                                                                                                                                                                                                                                                                                                   
----                           -----                                                                                                                                                                                                                                                                                                                                                                                                                   
ALLUSERSPROFILE                C:\ProgramData                                                                                                                                                                                                                                                                                                                                                                                                          
APPDATA                        C:\Users\GARLIN\AppData\Roaming                                                                                                                                                                                                                                                                                                                                                                                         
CommonProgramFiles             C:\Program Files (x86)\Common Files                                                                                                                                                                                                                                                                                                                                                                                     
CommonProgramFiles(x86)        C:\Program Files (x86)\Common Files                                                                                                                                                                                                                                                                                                                                                                                     
CommonProgramW6432             C:\Program Files\Common Files                                                                                                                                                                                                                                                                                                                                                                                           
COMPUTERNAME                   Y50-70                                                                                                                                                                                                                                                                                                                                                                                                                  
ComSpec                        C:\WINDOWS\system32\cmd.exe                                                                                                                                                                                                                                                                                                                                                                                             
DriverData                     C:\Windows\System32\Drivers\DriverData                                                                                                                                                                                                                                                                                                                                                                                  
FPS_BROWSER_APP_PROFILE_STRING Internet Explorer                                                                                                                                                                                                                                                                                                                                                                                                       
FPS_BROWSER_USER_PROFILE_ST... Default                                                                                                                                                                                                                                                                                                                                                                                                                 
HOMEDRIVE                      C:                                                                                                                                                                                                                                                                                                                                                                                                                      
HOMEPATH                       \Users\GARLIN                                                                                                                                                                                                                                                                                                                                                                                                           
LOCALAPPDATA                   C:\Users\GARLIN\AppData\Local                                                                                                                                                                                                                                                                                                                                                                                           
LOGONSERVER                    \\Y50-70                                                                                                                                                                                                                                                                                                                                                                                                                
NUMBER_OF_PROCESSORS           2                                                                                                                                                                                                                                                                                                                                                                                                                       
OneDrive                       C:\Users\GARLIN\OneDrive                                                                                                                                                                                                                                                                                                                                                                                                
OS                             Windows_NT                                                                                                                                                                                                                                                                                                                                                                                                              
Path                           C:\WINDOWS\system32;C:\WINDOWS;C:\WINDOWS\System32\Wbem;C:\WINDOWS\System32\WindowsPowerShell\v1.0\;C:\WINDOWS\System32\OpenSSH\;C:\Users\GARLIN\AppData\Local\Microsoft\WindowsApps                                                                                                                                                                                                                                    
PATHEXT                        .COM;.EXE;.BAT;.CMD;.VBS;.VBE;.JS;.JSE;.WSF;.WSH;.MSC;.CPL                                                                                                                                                                                                                                                                                                                                                              
PROCESSOR_ARCHITECTURE         x86                                                                                                                                                                                                                                                                                                                                                                                                                     
PROCESSOR_ARCHITEW6432         AMD64                                                                                                                                                                                                                                                                                                                                                                                                                   
PROCESSOR_IDENTIFIER           Intel64 Family 6 Model 60 Stepping 3, GenuineIntel                                                                                                                                                                                                                                                                                                                                                                      
PROCESSOR_LEVEL                6                                                                                                                                                                                                                                                                                                                                                                                                                       
PROCESSOR_REVISION             3c03                                                                                                                                                                                                                                                                                                                                                                                                                    
ProgramData                    C:\ProgramData                                                                                                                                                                                                                                                                                                                                                                                                          
ProgramFiles                   C:\Program Files (x86)                                                                                                                                                                                                                                                                                                                                                                                                  
ProgramFiles(x86)              C:\Program Files (x86)                                                                                                                                                                                                                                                                                                                                                                                                  
ProgramW6432                   C:\Program Files                                                                                                                                                                                                                                                                                                                                                                                                        
PSModulePath                   C:\Program Files\WindowsPowerShell\Modules;C:\Users\GARLIN\Documents\WindowsPowerShell\Modules;C:\Program Files (x86)\WindowsPowerShell\Modules;C:\WINDOWS\system32\WindowsPowerShell\v1.0\Modules                                                                                                                                                                                                                      
PUBLIC                         C:\Users\Public                                                                                                                                                                                                                                                                                                                                                                                                         
SystemDrive                    C:                                                                                                                                                                                                                                                                                                                                                                                                                      
SystemRoot                     C:\WINDOWS                                                                                                                                                                                                                                                                                                                                                                                                              
TEMP                           C:\Users\GARLIN\AppData\Local\Temp                                                                                                                                                                                                                                                                                                                                                                                      
TMP                            C:\Users\GARLIN\AppData\Local\Temp                                                                                                                                                                                                                                                                                                                                                                                      
USERDOMAIN                     Y50-70                                                                                                                                                                                                                                                                                                                                                                                                                  
USERDOMAIN_ROAMINGPROFILE      Y50-70                                                                                                                                                                                                                                                                                                                                                                                                                  
USERNAME                       GARLIN                                                                                                                                                                                                                                                                                                                                                                                                                  
USERPROFILE                    C:\Users\GARLIN                                                                                                                                                                                                                                                                                                                                                                                                         
windir                         C:\WINDOWS

4. New environment variables can be added persistently, by using:
- Advanced System Settings / Environment Variables
- "setx" or "setx /m" commands from CMD
- [System.Environment]::SetEnvironmentVariable() from PowerShell

If you mess up environment variables, the only ones to really care about are in Machine scope & User scope. Some of your apps will create their own variables under Machine or User, but you will have to find out what those defaults on your own. They will vary by specific app.
Thanks for the help, my man! I really appreciate you taking the time to break it down for me. Now that I can see the exact breakdown in the amount of detail which you put into this, next time I can navigate around the variables easily and know exactly what I'm looking at and what each of them pertain to. Thanks again to you both, awesome community you guys have here.
 

My Computer

System One

  • OS
    Microsoft Windows 11 Pro 10.0.26100 Build 26100
    Computer type
    PC/Desktop
    Manufacturer/Model
    LENOVO 90T00003US (IdeaCentre Gaming 5 17IAB7)
    CPU
    12th Gen Intel(R) Core(TM) i7-12700 Clocked at 4.59 GHz
    Motherboard
    LENOVO SDK0T76461 WIN 3422111214830
    Memory
    Ramaxel Technology 16.0 GB DDR4
    Graphics Card(s)
    Nvidia GeForce RTX 3060 12GB
    Monitor(s) Displays
    LG Ultragear
    Screen Resolution
    2560x1440 180Hz

Latest Support Threads

Back
Top Bottom