How to Set Environment Variables in Windows 10
Windows 10 supports a number of legacy features from older versions of the operating system. One of those legacy features is the environment variable.
Environment variables offer a useful way to control the way Windows operates with an extremely small footprint in terms of memory usage.
For example, one common environment variable is called PATH, which is simply an ordered text string containing a list of directories that Windows should look in when an executable file is called.
The PATH environment variable allows users to quickly launch programs without having to know where those programs live on the hard drive.
Setting environment variables is very useful and, fortunately, very simple. In this article, we’ll go over how to find and set your environment variables in Windows 10.
How Do I Set Environment Variables in Windows 10?
Once logged in to Windows, right-click the Windows button in the lower-left corner of your screen. This will open up the Power User Tasks Menu.
Depending on your settings, this process may open the Start menu instead. If it opens the Start menu, type “Windows-x“ on your keyboard to open the Power User Task Menu.
Click System from the Power User Task Menu that’s displayed on the screen.
Under the System menu, you need to click the Advanced System Settings.
If you can’t find Advanced System Settings there, type “advanced system settings” into the search box and hit return to bring it up.
Once Advanced System Settings is open, click on the Advanced tab, then look on the bottom-right side for the Environment Variables.
Next, to create a new environment variable, click New.
A dialog box will pop up, allowing you to enter a new variable name and to set its initial value:
- New adds a new environment variable.
- Edit lets you edit whatever environment variable you have selected.
- Delete lets you delete the selected environment variable.
Save any changes that you make by clicking OK.
How to Find the PATH Variable
Under the Environment Variables window, choose or highlight the PATH variable in the System Variables section shown in the window.
After highlighting the PATH variable from System Variables, click the Edit button.
You can add or modify the path lines with the directories you want your computer to look in for executable files. You will find that each different directory is separated with a semicolon, for example:
There are other environment variables in the System Variables section that you can examine by clicking Edit.
Likewise, there are different environment variables, such as PATH, HOME and USER PROFILE, HOME and APP DATA, TERM, PS1, MAIL, TEMP, and so on. These Windows environment variables are very useful and can be used in scripts as well as on the command line.
Speaking of the command line, you can test your changes by opening a new PowerShell window and entering the following:
Frequently Asked Questions
Here is some more information about Environment Variables for you:
How Do I Find Environment Variables in Windows 10?
To find environment variables in Windows 10, you can follow the steps described above to find the environment variable information tucked away inside the system’s advanced settings.
Alternatively, if you just need to see what the variables are but don’t need to change them, you can simply open a command-line interface by hitting Ctrl-Esc and typing “cmd” in the command box, then type “set” in the command window. This prints out all the environment variables that are set on your system.
Why can’t I edit the Environment Variables?
There are several reasons that you may not be able to set these variables. The first of your problems could be that you don’t have Admin rights. To set or edit this function, you must be the Administrator of the system.
If you are the Admin, yet the edit function is greyed out, try accessing the Environment Variables by accessing the Control Panel from the Start menu. Click on ‘Advanced System Settings,’ then click ‘Environment Variables.’
Windows 10 environment variables make it incredibly easy to take control of your Windows device and make it run more efficiently.
To find and set environment variables in Windows 10, follow the simple steps laid out in this article to get started.