The graphical interface is the most effective way to get most things done on Windows. However, you may need to use the command line from time to time for troubleshooting, programming, or simply to improve your nerd cred.
If you want to execute something that isn’t part of Windows by default, you’ll need to add it to your Windows PATH variable. When you ask for executables, your system will know where to look for them.
What is PATH?
Environment variables store information about a system’s surroundings so that the system knows where to look for certain data. The PATH variable is one of the most well-known environment variables because it appears on Windows, Macintosh, and Linux devices and performs a similar function on all of them. In its most basic form, it’s merely a text string providing a list of directory paths that the system will look for whenever you request a program.
Adding a desktop shortcut to your command line is similar to this. To launch Python, instead of typing “C:\Users\username\AppData\Local\Programs\Python\Python38-32\python.exe” you can add the folder containing the file to the PATH variable and simply type “python” in the future. Do this for any software you choose, whether it’s a graphical user interface (like Notepad) or a command line interface (like Python).
On Windows, PATH (conventional uppercase only because the Windows NTFS file system is not case sensitive) points to the “C:\Windows” and “C:\Windows\system32” directories by default.
When you type “charmap” on the command line, you get a huge list of Unicode characters that you can copy and use, for example. “Notepad” runs Notepad, “msinfo32” gives you a list of your computer’s specifications, and so on.
These programs can also be started through the GUI. However, if you are already working on the command line, it is much easier to start programs just by typing their name. This is especially true if you are trying to start a program that opens and runs in the command line interface, such as Python or Node.js.
How do I edit the PATH variable?
The Windows GUI is pretty simple, so for most people, editing the PATH is probably the best way to go.
Using the Windows GUI
1. Open “System Properties” and go to the “Advanced” tab. The easiest way to do this is by typing
environment variable into your Windows Search bar and clicking “Edit the system environment variables.”
Alternatively, you can go to “Control Panel -> System and Security -> System” and click “Advanced system settings;” type
sysdm.cpl into the Run command; or right-click “This PC,” select “Properties,” and click “Advanced system settings.” They all go to the same place.
2. Once you’re in the “Advanced” tab, click “Environment Variables … ”
3. The top field contains user variables, i. H. All changes apply to your account only. If you have multiple accounts on one computer and you want the changes to affect all of them, edit the bottom field with the system variables.
4. Select the user or system Path variable (don’t let the title-case throw you; PATH and Path are the same in Windows) you want to edit and click the “Edit … ” button below the box.
6. If you prefer to navigate to the folder and select it manually, use the Browse button to navigate to the folder where your executable is located and click the OK button when you are there.
7. If you want your program to start a little faster, you can use the “Up” and “Down” buttons to move the folder up so that it appears more quickly in the directory search.
8. Open a new command prompt window and test your program by entering the name of the executable file you want to start. It doesn’t work in the current window as you are still using the old PATH variable.
Edit PATH Variables Using Command Prompt
The Windows 10 GUI is very easy to use and should meet the needs of most users, but if you need to use the command line to set PATH and environment variables, you can too.
1. Open the command prompt as administrator and enter the command set.
2. Scroll through the list of routes and then find the variable you want to edit. The variable name is the part before the “=” character, the variable value is the part after it, which is renamed in the directory it should refer to.
3. With that in mind, to edit the PATH, enter the following command:
You can use the following code to configure the System PATH from the command prompt. (Execute as an administrator). To use it to set your User PATH, just remove the
If you are having problems, read the known issues and fixes to the setx command to reduce the variable to 1024 characters or change the variable in another way. Make sure to make a backup copy of the user and system path variables first.
Frequent Asked Questions
1. Why would I need to edit PATH?
By the time you’re reading this, you’ve probably come across something that requires adding it to the PATH variable, so that’s probably what you should do. However, if you just want to add something to your PATH for easy access, that’s fine too. Just make sure it doesn’t interfere with the higher priority programs.
2. Is there a Windows PATH length limit?
Yes, there is. So PATH-changing enthusiasts beware that the limit is 260 characters.
3. Can I disable the Windows PATH length limit?
Yes you can! Go to the Registry Editor, then within that navigate to:
In the right-side pane, double-click the entry called “LongPathsEnabled”, then change the “Value data” value from 0 to 1. Click OK, and you’re good to go.