239

How do I set a system environment variable in Windows 10 (without using the registry editor)?

(Note: Other answers don't specifically address Windows 10 - at least not yet - and they leave off important steps - like how to open the control panel - that changed since previous versions of Windows.)

Jared
  • 2,669

9 Answers9

178

Update: After seeing lots of comments about setting environment variables without admin in Windows 10, I think I have found a way. I was not admin and could use PowerShell.

PowerShell method

You can list all environment variables with: Get-ChildItem Env:.

To get the value of a specific variable: $Env:PATH, where PATH is the name of the variable.

To set a variable: [Environment]::SetEnvironmentVariable("PATH", "C:\TestPath", "User"), the first parameter is the name of the variable, the second is the value, the third is the level of.

There are different ways to work with environment variables and certain quirks with them in PowerShell so consult the link for details.

Old method (no longer available in newer Windows 10 updates, use PowerShell or see other answers)

Go into Settings and click on System.

System

Then on the left side click About and select System info at the bottom.

About

In the new Control Panel window that opens, click Advanced system settings on the left.

Advanced system settings

Now in the new window that comes up, select Environment Variables... at the bottom.

Environment Variables

MC10
  • 10,620
127

Still the same as ever: It’s in the old-style control panel’s “System” thingy. You can reach it with WinBreak or by right-clicking the Start button.

From there, select “Advanced system settings” → “Environment Variables”.

Or you can do it the hard way and find some other entry point to the old-style control panel, like the Network and Sharing Center or the Desktop folder(!).

user219095
  • 65,551
112

I typed "envir" in the "Search the web and Windows" box and selected "Edit environment variables for your account" under the "Best Match"

enter image description here

Colin
  • 1,221
34

If by "system environment variables" you refer specifically to system-wide environment variables, then other answers have already covered this. However, if you want to edit both system-wide and user-specific environment variables then most (if not all) of these answers are inapplicable in general case.

Going through "System" and then “Advanced system settings” -> “Environment Variables” will only work for accounts from Administrators group, because only such accounts have access to “Advanced system settings”.

If you attempt do that from a regular user account, then trying to access “Advanced system settings” will trigger an UAC prompt asking you for administrator password. If you enter the password, “Advanced system settings” will successfully open, but any user-specific changes you make there will apply to the corresponding administrator's account (!), not to your original user's account.

In order to solve this problem (i.e. in order to give regular users the opportunity to edit their own environment variables) Windows provides another way to access the “Environment Variables” dialog.

Open Control Panel. Open User Accounts applet. On the left-hand side of that applet you will see a link that says Change my environment variables. Click that link, and it will take you to the same “Environment Variables” dialog for your user's environment variables.

enter image description here

If your user has administrator rights, you will be able to edit both sections of that dialog: user-specific environment variables (upper section) and system-wide environment variables (lower section). If you don't have administrator rights, you will only be able to edit the upper section: your own user-specific environment variables.

This is the proper way to edit environment variables in all post-UAC versions of Windows, not what is suggested in the majority of the answers above.


Unfortunately, Windows 10 November update (version 1511) destroyed this functionality. The Change my environment variables link no longer works. It is there, but it is dead. So for the post-November version of Windows 10 the correct answer is: it is generally impossible to edit user-specific environment variables in version 1511 of Windows 10 from regular user accounts. Microsoft has destroyed Windows 10 with this update and Windows 10 is now unusable. It will remain the case until they fix these ridiculous bugs in 1511 version of the OS.

For the time being one workaround for non-administrative accounts is to, well, add your user account to Administrators group, logout, log back in, edit the variables using "System" -> “Advanced system settings” method, and then take away administrative rights again...

An alternative workaround is to use PowerShell features as described here https://technet.microsoft.com/en-us/library/ff730964.aspx


Windows 10 Anniversary Update (version 1607) released August 2, 2016 finally fixed this bug.

25

Just hit Windows Key+R) at the same time to get command prompt. Then type sysdm.cpl, go to advanced and select Environmental Variables

enter image description here

Journeyman Geek
  • 133,878
7

I also experience the problem described by many users in this thread, i.e. the link to the dialogue to set the environment variables of non-admin users is dead. As a simple workaround I have downloaded this nice tool:

http://www.rapidee.com/en/download

It is portable and requires no permissions to install, it is simple to use, and actually provides a better overview of the variables than the system dialogue anyway.

Hope this helps.

krcools
  • 171
5

If you are not afraid of the command line, you should check out the command setx.

I quote from its description:

Creates or modifies environment variables in the user or system environment. Can set variables based on arguments, regkeys or file input.

(Note that this command does not affect the current command shell's environment, only the environment of new processes, so you'll need to open a new command shell to see any changes.)

fogbanksy
  • 151
4

I found at least one way:

In the "Search the web and Windows" box on the taskbar, type "environment variables" then select "Edit the system environment variables" then click "Environment variables"

Jared
  • 2,669
2

In windows 10, changing the environment variables has not changed, It is the same as in windows 7: Right click on This PC (My Computer). Left Click Properties. Left Click Advanced system settings. Left Click Environment Variables...

At this point you can change the variables for the current user or the system

Rob Moore
  • 409