Programmers, system administrators, and power users may need to work at some point with environment variables. Some may want to delete an environment variable; others will want to change its value, and so on.
This guide shares how to edit or delete environment variables, as well as how to unset environment variables in Windows:. To make many of the edits shown in this article, you first need to open the Environment Variables window. This guide explains how to do that and shows you the basics about working with environment variables: What are environment variables in Windows?
If you want to change the value of an existing environment variable, first select it in the Environment Variables window. Then, click or tap Edit. You are shown a window where you can edit both the name and the windows 10 set environment variable shortcut free download of the variable.
Make the modifications you desire and press OK. Then, press OK one more time in the Environment Variables window. You can create a new environment variable, or edit the value of an existing environment variable but not its name from the Command Prompt too. The command you have to enter is:.
If we want to change the value of an environment variable, we can run the same setx command but specify windows 10 set environment variable shortcut free download new value for the variable.
How to change the value of an environment variable in Command Prompt. That works because the setx command rewrites the existing value with the last one you type. Therefore, if you use this command multiple times on the same variable, the variable will keep the last value that you typed. If you want a variable to have multiple paths in its value, you must write them all, each separated by a semicolon, without spaces, like in the screenshot below.
How to add multiple values to an environment variable using Command Prompt. NOTE: You can get a list of all the environment variables available by running the set command in Command Prompt not setx, and without any parameters. However, if windows 10 set environment variable shortcut free download just created or edited an environment variable, you must close and reopen Command Prompt for the changes to show up. You can also create or edit the value of an existing environment variable from PowerShell.
The PowerShell command for that is:. To change the value of the variable later, we can run the same command using a different value. Just like setx in Command Promptthis command rewrites the value of the specified variable each time you run it. If you want to assign multiple values to a variable, type all of them in the command, with semicolons between each value, as illustrated below. How to add multiple values to an environment variable in PowerShell. However, if you just created or edited an environment variable, you must close and reopen PowerShell for the changes to show up.
If you want to remove the value of an environment variable while keeping its nameyou cannot do that with the mouse and keyboard from the Environment Variables window.
If you select a variable and press Edityou can delete the value, but you cannot press OKas this button gets grayed out. Therefore you cannot save your changes.
However, you can clear the value of an environment variable using Command Prompt. If you no longer want to use a particular environment variable, select it in the Environment Variables window. Then, press Delete. Windows does not ask for any confirmation of this action.
Therefore, if you have changed your mind, you must press Cancelso that the removal is not applied. If you want the deletion to go ahead, press OK. To delete an environment variable from Command Prompttype one of these two commands, depending on what type that variable is:. How to unset an environment variable in Windows using Command Prompt. You now know how to do all that.
But why did you want to change or edit environment variables? Was it because there were leftover variables on your system from certain apps that you no longer used? Or was it because you have a special setup, and you need to work with environment variables?
Let us know in the comments section below. This site, like many others, uses small files called cookies to help us improve and customize your experience. Learn more in our cookie policy. Search search input. How to edit, clear, and delete environment variables in Windows Windows 10 tutorial windows 10 set environment variable shortcut free download Codrut Neagu published on Quick Steps How to edit an environment variable in Windows:. In the Environment Variables window, select the variable you want to change.
Click or tap Edit. Press OK one more time in the Environment Variables window. Related articles What is a Windows user group, and what does it do? Command Prompt: 11 basic commands windows 10 set environment variable shortcut free download should know cd, dir, mkdir, etc.
How to create user variables and system environment variables in Windows Windows 10 keyboard shortcuts. The complete list, plus free PDF download! This Site Uses Cookies.
Granular Cookie Control Functional.