Page 1 of 4 123 ... LastLast
    Environment Variables in Windows 10

    Environment Variables in Windows 10

    Complete List of Environment Variables in Windows 10
    Published by Category: General Tips
    15 May 2017
    Designer Media Ltd

    Published by


    Brink's Avatar
    Administrator

    Posts: 25,773

    Show Printable Version 


    Complete List of Environment Variables in Windows 10

    information   Information
    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.

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

    Note   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.





    Environment Variables Values (may vary)
    %ALLUSERSPROFILE% C:\ProgramData
    %APPDATA% C:\Users\(user-name)\AppData\Roaming
    %CD% (command prompt only) Current directory full path
    %CMDCMDLINE% (command prompt only) Returns exact command line used to start current cmd.exe session.
    %CMDEXTVERSION% (command prompt only) Number of current command processor extensions.
    %CommonProgramFiles% C:\Program Files\Common Files
    %CommonProgramFiles(x86)% C:\Program Files (x86)\Common Files
    %CommonProgramW6432% C:\Program Files\Common Files
    %COMPUTERNAME% The computer name of the current local system.
    %COMSPEC% C:\Windows\System32\cmd.exe
    %DATE% (command prompt only) Current date in format determined by Date command
    %ERRORLEVEL% (command prompt only) Number defining exit status of previous command or program
    %HOMEDRIVE% C:
    %HOMEPATH% \Users\(user-name)
    %LOCALAPPDATA% C:\Users\(user-name)\AppData\Local
    %LOGONSERVER% \\MicrosoftAccount
    %NUMBER_OF_PROCESSORS% 8
    %OS% Windows_NT
    %PATH% C:\WINDOWS
    C:\WINDOWS\system32
    C:\WINDOWS\System32\Wbem
    C:\WINDOWS\System32\WindowsPowerShell\v1.0
    %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
    %ProgramData% C:\ProgramData
    %ProgramFiles% C:\Program Files
    %ProgramFiles(x86)% C:\Program Files (x86)
    %ProgramW6432% C:\Program Files
    %PROMPT% (command prompt only) Code for current command prompt format. Code is usually $P$G
    %PSModulePath% C:\Windows\system32\WindowsPowerShell\v1.0\Modules\
    %PUBLIC% C:\Users\Public
    %RANDOM% (command prompt only) To get random number between 0 and 32767
    %SessionName% 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.
    %SystemDrive% C:
    %SystemRoot% C:\Windows
    %TEMP% C:\Users\(user-name)\AppData\Local\Temp
    %TIME% (command prompt only) Current time in format determined by Time command
    %TMP% C:\Users\(user-name)\AppData\Local\Temp
    %USERDOMAIN% The network domain name associated with the current user.
    %USERDOMAIN_ROAMINGPROFILE% The network domain name associated with the current roaming profile.
    %USERNAME% (user-name)
    %USERPROFILE% C:\Users\(user-name)
    %WINDIR% C:\Windows



    That's it,
    Shawn


  1.    07 Mar 2016 #1
    Join Date : Jan 2015
    Posts : 30
    Windows 10

    How we use this?
    For example tried %OS% on CMD, PS and RUN but not work?
      My ComputerSystem Spec
  2.    07 Mar 2016 #2
    Join Date : Oct 2013
    Posts : 25,773
    64-bit Windows 10 Pro build 17046
    Thread Starter

    Hello Yasak,

    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.
    Last edited by Brink; 07 Mar 2016 at 11:17.
      My ComputersSystem Spec
  3.    07 Mar 2016 #3
    Join Date : Jan 2015
    Posts : 30
    Windows 10

    Ok understood.
    Thank you for answer
      My ComputerSystem Spec
  4.    07 Mar 2016 #4
    Join Date : Oct 2013
    Posts : 25,773
    64-bit Windows 10 Pro build 17046
    Thread Starter

      My ComputersSystem Spec
  5.    06 Jul 2016 #5
    Join Date : Jun 2015
    Posts : 12,965
    Windows 10 Pro

    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.
    Last edited by Brink; 16 Sep 2017 at 21:06. Reason: removed broken image
      My ComputersSystem Spec
  6.    06 Jul 2016 #6
    Join Date : Oct 2013
    Posts : 25,773
    64-bit Windows 10 Pro build 17046
    Thread Starter

    Hello Martijn,

    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?

    Click image for larger version. 

Name:	Environment_Variables.png 
Views:	650 
Size:	45.8 KB 
ID:	88618
      My ComputersSystem Spec
  7.    06 Jul 2016 #7
    Join Date : Jun 2015
    Posts : 12,965
    Windows 10 Pro

    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.
      My ComputersSystem Spec
  8.    06 Jul 2016 #8
    Join Date : Oct 2013
    Posts : 25,773
    64-bit Windows 10 Pro build 17046
    Thread Starter

    Interesting. %AppData% opens the C:\Users\Brink\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.
      My ComputersSystem Spec
  9.    06 Jul 2016 #9
    Join Date : Jun 2015
    Posts : 12,965
    Windows 10 Pro

    That opens the right path C:\Users\<user>\AppData\Roaming.
    Last edited by axe0; 07 Jul 2016 at 04:43. Reason: removed name
      My ComputersSystem Spec

 
Page 1 of 4 123 ... LastLast


Similar Threads
Tutorial Category
General Tips Troubleshoot Windows 10 failure to boot using Recovery Environment
How to Troubleshoot Windows 10 failure to boot using Recovery Environment Windows failing to boot can be a daunting experience, the Recovery environment built into Windows 10 is designed to overcome a variety of problems that cause Windows 10 to...
Tutorials
recovery environment?
Hi guys; what is "recovery environment" that comes up when booting win 10TP?
General Support
Solved A possible issue when setting up a folder in the environment path...
The other day I was setting up this: C:\Python27 in the environment variable path so I can access Python from the command prompt. Usually in the previous builds and in Win8/Win7 you just perform the set up in the PC/Computer properties and when...
General Support
Our Sites
Site Links
About Us
Windows 10 Forums is an independent web site and has not been authorized, sponsored, or otherwise approved by Microsoft Corporation. "Windows 10" and related materials are trademarks of Microsoft Corp.

Designer Media Ltd
All times are GMT -5. The time now is 02:28.
Find Us
Twitter Facebook Google+ Ten Forums iOS App Ten Forums Android App



Windows 10 Forums