Windows 10: Environment Variables in Windows 10

Discus and support Environment Variables in Windows 10 in Windows 10 Tutorials to solve the problem; How to: Environment Variables in Windows 10 Complete List of Environment Variables in Windows 10 Environment variables are a set of dynamic named... Discussion in 'Windows 10 Tutorials' started by Yasak Hayat, Mar 6, 2016.

  1. Environment Variables in Windows 10


    How to: Environment Variables in Windows 10

    Complete List of Environment Variables in Windows 10


    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%") 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).

    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.


    Environment Variables in Windows 10 [​IMG]
    Note 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.





    [table][tr][td]Environment Variables[/td] [td]Values (may vary)[/td] [/tr] [tr][td]%ALLUSERSPROFILE%[/td] [td]C:\ProgramData[/td] [/tr] [tr][td]%APPDATA%[/td] [td]C:\Users\(user-name)\AppData\Roaming[/td] [/tr] [tr][td]%CD%[/td] [td](command prompt only) Current directory full path[/td] [/tr] [tr][td]%CMDCMDLINE%[/td] [td](command prompt only) Returns exact command line used to start current cmd.exe session.[/td] [/tr] [tr][td]%CMDEXTVERSION%[/td] [td](command prompt only) Number of current command processor extensions.[/td] [/tr] [tr][td]%CommonProgramFiles%[/td] [td]C:\Program Files\Common Files[/td] [/tr] [tr][td]%CommonProgramFiles(x86)%[/td] [td]C:\Program Files (x86)\Common Files[/td] [/tr] [tr][td]%CommonProgramW6432%[/td] [td]C:\Program Files\Common Files[/td] [/tr] [tr][td]%COMPUTERNAME%[/td] [td]The computer name of the current local system.[/td] [/tr] [tr][td]%COMSPEC%[/td] [td]C:\Windows\System32\cmd.exe[/td] [/tr] [tr][td]%DATE%[/td] [td](command prompt only) Current date in format determined by Date command[/td] [/tr] [tr][td]%DriverData%[/td] [td]C:\Windows\System32\Drivers\DriverData[/td] [/tr] [tr][td]%ERRORLEVEL%[/td] [td](command prompt only) Number defining exit status of previous command or program[/td] [/tr] [tr][td]%HOMEDRIVE%[/td] [td]C:[/td] [/tr] [tr][td]%HOMEPATH%[/td] [td]\Users\(user-name)[/td] [/tr] [tr][td]%LOCALAPPDATA%[/td] [td]C:\Users\(user-name)\AppData\Local[/td] [/tr] [tr][td]%LOGONSERVER%[/td] [td]\\MicrosoftAccount[/td] [/tr] [tr][td]%NUMBER_OF_PROCESSORS%[/td] [td]8[/td] [/tr] [tr][td]%OneDrive%[/td] [td]Current OneDrive folder location[/td] [/tr] [tr][td]%OS%[/td] [td]Windows_NT[/td] [/tr] [tr][td]%PATH%[/td] [td]C:\WINDOWS C:\WINDOWS\system32 C:\WINDOWS\System32\Wbem C:\WINDOWS\System32\WindowsPowerShell\v1.0[/td] [/tr] [tr][td]%PATHEXT%[/td] [td]COM;.EXE;.BAT;.CMD;.VBS;.VBE;.JS;.JSE;.WSF;.WSH;.MSC[/td] [/tr] [tr][td]%PROCESSOR_ARCHITECTURE%[/td] [td]AMD64[/td] [/tr] [tr][td]%PROCESSOR_IDENTIFIER%[/td] [td]Intel64 Family 6 Model 60 Stepping 3, GenuineIntel[/td] [/tr] [tr][td]%PROCESSOR_LEVEL%[/td] [td]6[/td] [/tr] [tr][td]%PROCESSOR_REVISION%[/td] [td]3c03[/td] [/tr] [tr][td]%ProgramData%[/td] [td]C:\ProgramData[/td] [/tr] [tr][td]%ProgramFiles%[/td] [td]C:\Program Files[/td] [/tr] [tr][td]%ProgramFiles(x86)%[/td] [td]C:\Program Files (x86)[/td] [/tr] [tr][td]%ProgramW6432%[/td] [td]C:\Program Files[/td] [/tr] [tr][td]%PROMPT%[/td] [td](command prompt only) Code for current command prompt format. Code is usually $P$G[/td] [/tr] [tr][td]%PSModulePath%[/td] [td]C:\Windows\system32\WindowsPowerShell\v1.0\Modules\[/td] [/tr] [tr][td]%PUBLIC%[/td] [td]C:\Users\Public[/td] [/tr] [tr][td]%RANDOM%[/td] [td](command prompt only) To get random number between 0 and 32767[/td] [/tr] [tr][td]%SessionName%[/td] [td]When 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.[/td] [/tr] [tr][td]%SystemDrive%[/td] [td]C:[/td] [/tr] [tr][td]%SystemRoot%[/td] [td]C:\Windows[/td] [/tr] [tr][td]%TEMP%[/td] [td]C:\Users\(user-name)\AppData\Local\Temp[/td] [/tr] [tr][td]%TIME%[/td] [td](command prompt only) Current time in format determined by Time command[/td] [/tr] [tr][td]%TMP%[/td] [td]C:\Users\(user-name)\AppData\Local\Temp[/td] [/tr] [tr][td]%USERDOMAIN%[/td] [td]The network domain name associated with the current user.[/td] [/tr] [tr][td]%USERDOMAIN_ROAMINGPROFILE%[/td] [td]The network domain name associated with the current roaming profile.[/td] [/tr] [tr][td]%USERNAME%[/td] [td](user-name)[/td] [/tr] [tr][td]%USERPROFILE%[/td] [td]C:\Users\(user-name) [/td] [/tr] [tr][td]%WINDIR%[/td] [td]C:\Windows[/td] [/tr] [/table]



    That's it,
    Shawn


    Related Tutorials

    :)
     
    Yasak Hayat, Mar 6, 2016
    #1
  2. Bob_880 Win User

    Environment Variable

    Hi,

    I accidentally deleted the entire environment variables on my windows 10 PC. Resetting the Pc is creating a lot of problems. The reset page would only load 47% and prompted me with a message "undoing changes." Is there a way someone can suggest to resolve
    this problem?
     
    Bob_880, Mar 6, 2016
    #2
  3. 希龙 Win User
    希龙, Mar 6, 2016
    #3
  4. Brink
    Brink New Member

    Environment Variables in Windows 10

    Hello Yasak, *Smile

    The %OS% variable contains a symbolic name of the operating system family to distinguish between differing feature sets in batchjobs. In this case, it would for when you want to use the Windows_NT string.

    I'm not sure what you could use it for though.
     
    Brink, Mar 6, 2016
    #4
  5. Ok understood.
    Thank you for answer *Smile
     
    Yasak Hayat, Mar 6, 2016
    #5
  6. axe0 New Member
    Shawn,
    Do you know why I cannot access certain environment variables?
    For example, if I want to go to %appdata% through search I get this result

    I also cannot get access to 'Change my environment variables' in User Account.
     
    axe0, Jul 5, 2016
    #6
  7. Brink
    Brink New Member
    Hello Martijn, *Smile

    Odd. That looks more like it's through "Open with" instead of Search.

    Are you able to open Environment Variables using the path below instead?


    Environment Variables in Windows 10 [​IMG]
     
    Brink, Jul 5, 2016
    #7
  8. axe0 New Member

    Environment Variables in Windows 10

    That pops up when I enter %appdata% in search through Windows logo + r search, if I presss only Windows logo it works fine.

    Yes that works fine.
     
    axe0, Jul 5, 2016
    #8
  9. Brink
    Brink New Member
    Interesting. %AppData% opens the C:\Users\\AppData\Roaming folder for me in the Run command dialog.

    What does it open when you use %AppData% in the address bar of File Explorer and press Enter? It will be interesting to know if it does the same, or opens the correct folder.
     
    Brink, Jul 5, 2016
    #9
  10. axe0 New Member
    That opens the right path C:\Users\<user>\AppData\Roaming.
     
  11. Could you post step-by step screen shots of how you got this open with dialog?

    Winkey+S is search, Winky+R is run - both work for me with %appdata%

    I only ask because everything else you've tried works as it should - my thought is there might have been a typo

    Thanks

    Bill

    PS - Thanks for making this tut Shawn, it will save me a lot of typing explaining what %TEMP% is *Wink
     
    Slartybart, Jul 5, 2016
    #11
  12. Brink
    Brink New Member
    Good idea Bill. Maybe there's something in the process that Martijn is doing causing it??
     
    Brink, Jul 5, 2016
    #12
  13. axe0 New Member

    Environment Variables in Windows 10

    I've made a video of it to show it *Smile
    [youtube]hbp7N7Wm_p4[/youtube]
     
  14. Tahnks,

    It was hard to catch and I didn't really see the step that got you to the Open dialog
    but that's what I see - Open, not Run or Search


    Environment Variables in Windows 10 [​IMG]
     
    Slartybart, Jul 5, 2016
    #14
  15. Brink
    Brink New Member
    I don't see anything wrong with how it was done either.

    Martijn,

    Does it do this for anything else from the Run dialog?

    You might see if using OPTION ONE in the tutorial below to reset file associations to MS recommended default may have it work properly afterwards.

    https://www.tenforums.com/tutorials/8...dows-10-a.html
     
    Brink, Jul 5, 2016
    #15
Thema:

Environment Variables in Windows 10

Loading...
  1. Environment Variables in Windows 10 - Similar Threads - Environment Variables

  2. Powershell breaks with semicolons in the PATH environment variable

    in Windows 10 Gaming
    Powershell breaks with semicolons in the PATH environment variable: I've been going down a rabbit hole with how Powershell processes the PATH environment variable. I am developing a program that helps manage the PATH, and I recently discovered that it has issues when a path containing semicolons is added to the PATH.According to [this comment...
  3. Powershell breaks with semicolons in the PATH environment variable

    in Windows 10 Software and Apps
    Powershell breaks with semicolons in the PATH environment variable: I've been going down a rabbit hole with how Powershell processes the PATH environment variable. I am developing a program that helps manage the PATH, and I recently discovered that it has issues when a path containing semicolons is added to the PATH.According to [this comment...
  4. Powershell breaks with semicolons in the PATH environment variable

    in Windows 10 Network and Sharing
    Powershell breaks with semicolons in the PATH environment variable: I've been going down a rabbit hole with how Powershell processes the PATH environment variable. I am developing a program that helps manage the PATH, and I recently discovered that it has issues when a path containing semicolons is added to the PATH.According to [this comment...
  5. How Do I Combine an Environment Variable?

    in Windows 10 Customization
    How Do I Combine an Environment Variable?: How do I combine an environment variable?Should a combined environment variable be something like this?“C:\mesa3d-24.0.1-release-msvc\x86” + “C:\mesa3d-24.0.1-release-msvc\x64” = “C:\mesa3d-24.0.1-release-msvc\;”...
  6. How Do I Combine an Environment Variable?

    in Windows 10 Gaming
    How Do I Combine an Environment Variable?: How do I combine an environment variable?Should a combined environment variable be something like this?“C:\mesa3d-24.0.1-release-msvc\x86” + “C:\mesa3d-24.0.1-release-msvc\x64” = “C:\mesa3d-24.0.1-release-msvc\;”...
  7. How Do I Combine an Environment Variable?

    in Windows 10 Software and Apps
    How Do I Combine an Environment Variable?: How do I combine an environment variable?Should a combined environment variable be something like this?“C:\mesa3d-24.0.1-release-msvc\x86” + “C:\mesa3d-24.0.1-release-msvc\x64” = “C:\mesa3d-24.0.1-release-msvc\;”...
  8. System PATH ADD variable Environment doesn't work

    in Windows 10 Gaming
    System PATH ADD variable Environment doesn't work: As per this article: https://learn.microsoft.com/en-us/windows/deployment/usmt/usmt-recognized-environment-variables%USERPROFILE%can be entered in search box >Start menu and goes straight to my profile folder, but doesn't work in System ParthTrying to add wget, and do not...
  9. System PATH ADD variable Environment doesn't work

    in Windows 10 Software and Apps
    System PATH ADD variable Environment doesn't work: As per this article: https://learn.microsoft.com/en-us/windows/deployment/usmt/usmt-recognized-environment-variables%USERPROFILE%can be entered in search box >Start menu and goes straight to my profile folder, but doesn't work in System ParthTrying to add wget, and do not...
  10. Environment Variables Problem

    in Windows 10 Software and Apps
    Environment Variables Problem: Yesterday, i changed System Environment Variables to include node.js and now i can’t open SEV or command prompt and many other system apps. I tried in many ways opening SEV to edit them but i am unable to open it with admin rights even though i have them. When i try to open...