The path variable is a big time saver when you want to start an application from Windows Run or the command prompt.
From the command prompt, type path to get the current path variable. Edit the path in a text editor, then paste it back into the command prompt, and then press Enter. To set it using the Windows interface, use Windows Search to find Advanced System Settings and click on Environment Variables.
It’s important to make sure you don’t make a mistake when editing your path variable, so rather than changing it in the command prompt, you may want to set it through the Advanced Systems Setting interface.
What is the Path Variable?
Let’s start with a quick overview of what the path variable is. The path variable is a list of file paths used as shortcuts to where programs are stored. If you didn’t have it, every time you wanted to run a program from the command line or any time a piece of software wanted to call on another program to run, the entire path to that program would have to be used.
For example, you can open a command prompt, type in ipconfig, and then press Enter to run the utility that tells you some of your current network settings. That’s because the path for it is already in the path variable. If it weren’t, you would have to type the whole path plus ipconfig every time you wanted to use it. Not nearly as nice.
The same goes for programmers writing software. To save time and simplify code, they will sometimes leverage the path variable in their programming.
Set the Path Variable Using the System Settings Interface
Searching for the Utility
If you’re the kind of person who likes to search for things rather than click through menus, you’re in luck. On most Windows operating systems, this path variable has been kept mostly in the same place. If you open up Windows search and search for Advanced System Settings, it will come up.
Once you have that open, you should be able to see Environment Variables. Click on that to access the environment variable editing interface.
Menu Sequence to Find the Utility
If you’re a menu clicker, the way you navigate to this utility differs between operating systems.
For Windows 2000 and Windows XP, you need to right-click My Computer, select Properties, and then select Advanced in the System Properties window. Next, you should be able to see the Environment Variables button, which opens up the utility.
Windows Vista and Windows 7 are a bit similar in that you right-click My Computer and select Properties. Next, click on Advanced System Settings in the left column. Once that is open, if the Advanced tab isn’t already selected, click on it. At that point, you’ll be able to see the Environment Variables button.
Windows 8 is slightly different in that you need to right-click the Start button to access the Power User Task Menu. Once it’s open, select System; then, in the left-hand column, select Advanced System Settings. If the Advanced tab hasn’t been selected, click on it. The Environment Variables button should be there.
Windows 10 also uses the Power User Task Menu, meaning you can open it up by right-clicking on the Start button. Select System like on Windows 8. But here’s where it’s a bit different.
On the right-hand side, click on System info. On the window that pops up, select Advanced System Settings. If the Advanced tab isn’t already prominent, click on it to make it so. Voila, the Environment Variables button will be there for you.
How to Use the Environment Variables Utility
Now that you have the Environment Variables window open, you’ll notice that there are two types. One is User Variables, which are user-specific only, and the other is System Variables, which apply system-wide to all users.
I usually need to change the System Variables, but if you’re tailoring something for a particular purpose, you may want to make your edits to the User Variable.
To make changes to the path variable, highlight the variable called ‘Path’ by clicking it once and then click the correct Edit button right under the window where you just highlighted the variable. This will place you into a utility where you can add or remove paths from your path variable.
When you open this utility, you should first click into the open space below the existing variables so that nothing is highlighted. Without doing this, you may accidentally edit one of the existing variables that you want to keep.
If this happens, you can fix your mistake by clicking Cancel in the bottom right. After that, the utility will close, and your changes won’t be kept.
Ok, so let’s review some of the options. First, you can add new variables, enabling you to type in the path or paste it in. Second, you can click on one of the existing variables and Edit them manually. Again, you can type in edits or paste them in. Third, you can Browse for new paths, which is helpful. Finally, if I don’t have the new path handy, you can navigate to it instead.
Usually, if you’re using Add or Browse and nothing is highlighted, the new paths get added to the bottom, which is good. However, there are reasons the order is essential, which usually involves possible naming conflicts. As a rule of thumb, you will want to add new paths to the bottom.
If somehow your new paths aren’t showing up at the bottom, you should double-check that you didn’t overwrite something important with your new entry.
If you need to change the order, for some reason, manually, you can use the Up and Down buttons to do so. Just select the entry and click up or down as necessary.
Once you’re sure that your edits are complete and everything is accurate, click Ok in the bottom right to save your changes and close the utility. You can verify that your changes have been saved by reopening the utility or using the command prompt method described below.
Set the Path Variable Using the Command Prompt
If you’re a more experienced computer user and you would like to use the command line to check and set your path variable, here’s how to do it.
First, you need to open up your command prompt terminal. You can find it in Windows 10 by clicking Start -> Windows System -> Command Prompt. Other versions of Windows like to place it in different locations, but it usually isn’t too difficult to find.
Personally, I would instead use Windows Search or Windows Run to find and execute the command prompt application named ‘cmd’ instead. I like it because it’s fast and works across Windows OS versions. This little command prompt program is actually useful for other things, but that’s something for another article.
Once you have your command prompt open, type ‘path’ and then enter. The response you will get is the full path variable, a list of paths separated by semi-colons. Some features of Windows work a little differently in the command prompt than in other applications.
You can select the entire path variable, including the PATH= portion, but you need to right-click the highlighted text to copy it. In the command prompt, right-clicking highlighted text is equivalent to CTRL-C or copying to the clipboard.
To reduce the chance of making a mistake, I paste the copied text into a text editor. You could use anything. Notepad, Wordpad, or Word, if you have it, will all work.
Next, open Windows Explorer and navigate to the folder you would like added to the path variable. Click into the title bar with the folder names to highlight it. Ensure the whole thing is highlighted, and use CTRL-C or right-click and select copy to copy it to the clipboard.
Notice the pattern of semi-colons used on the path variable. Every file path is ended with a semi-colon. That means you can paste your new path to the end of the variable and then append another semi-colon.
Once you’ve done that, double-check the new path variable for any apparent errors. Then, select and copy your new path variable, including the PATH= at the beginning.
Back in the command prompt, paste in your new path variable using CTRL-V but don’t press enter yet. When you press Enter, the old path variable will be overwritten by the new one here. Take a moment to inspect your new path variable for any obvious mistakes like spaces, clipped ends, or anything else that stands out to you.
Once you’re satisfied that everything is correct, press Eenter. Congratulations! You just updated your path variable.
Type in ‘path’ and press enter once to verify that the path variable now includes the new path you inserted. And you’re done!