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 have been a powerful feature of Windows from the earliest days; in fact, they predate Windows and come from MS-DOS.
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 utility programs or other 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 corner button (the little Windows icon) 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 find and click the Advanced System Settings link that you’ll find in the left-hand column under System.
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 button you will find on the lower right-hand side. Click Environment Variables.
Next, to create a new environment variable, just click New.
A dialog box will pop up, allowing you to enter a new variable name and to set its initial value:
- New enables you to add a new environment variable.
- Edit enables you to edit whatever environment variable you have selected.
- Delete, of course, enables you to delete the selected environment variable.
Save any changes that you make by clicking OK.
How to Choose the PATH
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 includes a variety of useful legacy features that were originally developed for earlier versions of the operating system.
Environment variables are one of these features that make it incredibly easy to take control of your Windows device and make it run with a relatively small footprint in terms of memory usage.
To find and set environment variables in Windows 10, follow the simple steps laid out in this article to get started.
For a how-to on using the Windows command line, check out this TechJunkie tutorial: Guide to the Windows 10 Command Prompt.
If you’re already a Windows power user, you may want to Replace Command Prompt with PowerShell in the Windows 10 Power User Menu.
Do you have any tips or tricks for setting and managing environment variables in Windows? Please tell us about it in a comment below.