What is Windows PATH?

If you are trying to run something that is not part of Windows, you will need to add it to the PATH variable. That tells the system where to look for executable files when you request them.

The most effective way to do almost anything on Windows is through the graphical interface. However, sometimes you have to switch to the command line to troubleshoot or program, etc. But if you are trying to run something that is not part of Windows, you will need to add it. PATH variable. That tells the system where to look for executable files when you request them.

What is PATH?

Environment variables store data about a system environment, so that it knows where to look for certain information. The PATH variable is one of the best known environment variables, because it exists on Windows, Mac, Linux machines and does the job directly with the user. The actual form of PATH is just a text string containing a list of directory paths that the system will search every time you request a program.

What is Windows PATH? Picture 1What is Windows PATH? Picture 1 PATH is just a text string containing a list of directory paths that the system will search

This is like adding a shortcut on the desktop to the command line. Instead of typing C: UsersusernameAppDataLocalProgramsPythonPython38-32python.exe to launch Python, you can add the folder containing the file to the PATH variable and simply type python to launch it in the future. Do it for whatever program you like, whether it launches the GUI (like Notepad) or works in the command line interface (like Python).

What is Windows PATH? Picture 2What is Windows PATH? Picture 2 Large list of Unicode characters that can be copied and used

On Windows, PATH (which is capitalized by convention, because Windows' NTFS file systems are not case sensitive) by default points to 'C: Windows' and ' C: Windowssystem32 ' folders . If you enter charmap into the command line, you'll get a large list of Unicode characters that can be copied and used, for example, 'notepad' running Notepad, 'msinfo32' giving you a list of the above specifications. computer, etc.

These programs can also be launched with the GUI. But if you're already working in the command line, launching programs just by typing their names will be a lot easier. This is especially true if you are trying to launch a program that will open and run inside the command line interface, like Python or Node.js.

How do I edit the PATH variable?

The Windows GUI is quite simple, so it is probably the best way for most people to edit PATH.

Use the Windows GUI

1. Open System Properties and go to the Advanced tab . The easiest way to do this is to enter the environment variable into the Windows Search bar and click Edit the system environment variables .

Alternatively, you can go to Control Panel> System and Security> System and click on Advanced system settings . Type sysdm.cpl into Run ; Or right-click This PC , select Properties and click Advanced system settings .

2. Once you are in the Advanced tab , click Environment Variables

What is Windows PATH? Picture 3What is Windows PATH? Picture 3 Click on Environment Variables .

3. The top box contains user variables, meaning that all edits will only apply to your account. If you have multiple accounts on one machine and want the changes to affect everyone, instead edit the bottom box containing system variables.

4. Select the Path variable of the user or system (note that PATH and Path are the same in Windows) that you want to edit and click the Edit . button below the box.

What is Windows PATH? Picture 4What is Windows PATH? Picture 4 Select the Path variable of the user or the system

5. If you already have the path to the folder you want to add, simply click New and paste it into the full path (not directly to the executable, but only to the directory where it is located). The author has pasted in the link to his NodeJS directory so he can use JavaScript in the command line.

6. If you can browse and select the directory manually, use the Browse button to navigate to the directory where the executable file is located and click the OK button while you are there.

What is Windows PATH? Picture 5What is Windows PATH? Picture 5 Use the Browse button to navigate to the directory where the executable file is located

7. If you want your program to launch a little faster, you can use the Move Up and Move Down buttons to place the folder closer to the top, and the program will appear faster in folder search.

8. Open a new Command Prompt window and test the program by entering the name of the executable file you want to launch. It will not work in the current window because it will still use the old PATH variable.

The Windows 10 GUI is very handy and meets most people's needs, but if you need to use the command line to set up PATH, you should note that it's not as simple as you think. Remember to back up both user variables and system paths before editing.

What is Windows PATH? Picture 6What is Windows PATH? Picture 6 Remember to back up both user variables and system paths before editing

You can use the following code to place your system PATH from the Command Prompt (run as admin):

setx /M PATH "%PATH%;"

Do you need to edit PATH?

Chances are, if you're reading this article, you've encountered something that needs to be added to the PATH variable, so editing is probably the right thing to do. If you just want to add something to the PATH for easier access, that's fine too. Just make sure it doesn't interfere with higher priority programs.

If you need to constantly work with environment variables and want something a little more powerful than the default Windows GUI or command line, the Rapid Environment Editor works well. It even includes tools to help you remove duplicate and / or broken links. Just remember to back up your computer before you make any changes.

5 ★ | 1 Vote