Skip to content

Published: July 16, 2015 | Applies to:

Learn how to know about environment variables, change user and system environment variables in Windows 10 using registry manipulation.

Environment variables is not a new term in context to Windows 10. People have known them for years, as they are available in Windows series since older days of Windows XP. But still the fact is that many newbies to Windows aren’t aware of them. In this article, we’ll let you know about these variables and show the way to edit or modify them.

Basically, environment variables are strings that contain information such as drive, path, or file name. They control the behavior of various programs. For example, %windir% is an environment variable which when run in Command Prompt, opens the Windows folder under system root drive such as C:\Windows. There are two kind of environment variables a Windows operating system have. The first category is of user environment variables, which the user(s) and/or administrator(s), both can modify anytime. Second class is of system environment variables, which only system admin(s) can modify.

Keep in mind that the user environment variables are different for each user of a particular computer. The variables include any that are set by the user, as well as any variables defined by programs, such as the path to the location of the program files. While for system environment variables, administrators can change or add environment variables that apply to the system, and thus to all system users. During installation, Windows Setup configures the default system variables, such as the path to the Windows files.

How To Change User And System Environment Variables In Windows 10

1. Open administrative or elevated Windows PowerShell. For this search in Windows by term windows powershell, pick Windows PowerShell from search results, right click on it and select Run as administrator.

Recommended : Use Windows PowerShell to find Windows Experience Index on Windows 10

2. Next, in the Windows PowerShell window, type following cmdlet and press Enter key:

Get-ChildItem Env:

How To Change System And User Environment Variables In Windows 10

This cmdlet output will show you the list all environment variables available on your system. You can also edit or modify the variables in Windows PowerShell itself, but this would be bit technical. So for the sake of readers, I’ll show you much familiar way to edit these variables.

Registry Disclaimer: The further steps will involve registry manipulation. Making mistakes while manipulating registry could affect your system adversely. So be careful while editing registry entries and create a System Restore point first.

3. Press Windows Key + R and put regedit in Run dialog box to open Registry Editor (if you’re not familiar with Registry Editor, then click here). Click OK.

Windows 10 Registry Editor

4. In the left pane of Registry Editor, navigate to following registry key:


How To Change System And User Environment Variables In Windows 10

5. At this registry location as shown above, you can see there are two user environment variables by default. To add a new environment variable, right click on blank space in the right pane, select New -> Expandable String Value. Change the string name so created from New Value #1 to whatever you want to say the variable. Now, for existing variables, double click on the variable string to add or modify its Value data:

How To Change System And User Environment Variables In Windows 10

Put you desired Value data in Edit String window and click OK. In this way, you can add or modify user environment variables.

6. In order to modify system environment variables, navigate to following registry key and perform the registry manipulation as described in previous step:

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

How To Change System And User Environment Variables In Windows 10

We’ve highlighted some important variables in the screenshot above. So in this way, you can add or modify system environment variables. You may need to restart your system, to make your changes effective.

List of environment variables in Windows 10

For your convenience, here is the complete list of environment variables in Windows 10.

VALUES (items in italic – variables)
%APPDATA% C:\Users\(user-name)\AppData\Roaming
%CD% Current directory full path
%CMDCMDLINE% Returns exact command line used to start current cmd.exe session.
%CMDEXTVERSION% 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
%COMSPEC% C:\Windows\System32\cmd.exe
%DATE% Current date in format determined by Date command
%ERRORLEVEL% Number defining exit status of previous command or program
%HOMEPATH% C:\Users\(user-name)
%LOCALAPPDATA% C:\Users\(user-name)\AppData\Local
%LOGONSERVER% \\MicrosoftAccount
%OS% Windows_NT




%PROCESSOR_IDENTIFIER% x86 Family 6 Model 69 Stepping 1, GenuineIntel
%ProgramData% C:\ProgramData
%ProgramFiles% C:\Program Files
%ProgramFiles(x86)% C:\Program Files (x86)
%ProgramW6432% C:\Program Files
%PROMPT% Code for current command prompt format. Code is usually $P$G
%PSModulePath% C:\Windows\system32\WindowsPowerShell\v1.0\Modules\
%PUBLIC% C:\Users\Public
%RANDOM% 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% Current time in format determined by Time command
%TMP% C:\Users\(user-name)\AppData\Local\Temp
%USERNAME% (user-name)
%USERPROFILE% C:\Users\(user-name)
%WINDIR% C:\Windows

Hope you find the article useful! Also learn how to scan your Windows 10 using Windows PowerShell.

SHARE: Facebook Google+ Twitter

1 Comment

  • Hey! Thanks for this. The link in Windows 10 for setting user environment variables doesn’t work, so this is now the only way to do it until that’s fixed. Just wanted to thank you and add that text so search engines point to your page as a solution. Thanks again.

  • Leave a Reply

    Your email address will not be published. Required fields are marked *

    What's New

    Recent Comments

    • Ron : The Windows updates made no difference. However, I realized ...

      14 hours ago

    • Ron : I'm running Windows 10, 1607, build 14393. Fix 1 is unrelat...

      15 hours ago

    • Kapil Arya : ^^ If you're on Windows 10 RT, you can try this fix....

      1 day ago

    • Faiz : Experiencing same issue in windows Mobile , Any Solution??...

      1 day ago

    • Kwin : Thank you sooooooooooo much!...

      1 day ago