Trusted answers to developer questions
Trusted Answers to Developer Questions

Related Tags


How to add an application path to system environment variables


When you download applications like Java, PHP, Python, etc., that execute files through the command prompt or terminal, you will have to add the path to the system environment variable in order for the command prompt to identify commands that will be run using this application.

Although some applications allow you to automatically add their path to the system environment variables during installation, there are still some applications for which this process must be done manually.

How to add the path in Windows 7 and above

The steps below outline the process of adding a path in Windows. Although the example is for Windows 10, it works for both Windows 7 and 8 as well.

Step 1

Go to the root folder that contains the application, locate the binary .exe file of the application, and copy the path address, as shown below:

For some applications, all you have to do is get the location of the bin folder.

Step 2

Now that you have successfully copied the path, head to your Windows search pane and start typing the keyword “environment”. You will see the option “edit system environment”; click it and you will be taken straight to the control panel system properties pane, as shown below:

The same process applies to all versions of Windows.

Step 3

Now that you are on the system properties pane, click on the environment properties button at the bottom left of the pane. The system environment variables pane pops up.

On this pane, look for the user variables for your pc_name section and select the path option. Finally, click the edit button on the screen.

When you click the edit button, the edit environment variable pop-up will be displayed.

In the image above, three panes are shown and the blue arrows indicate the flow of click actions.

For Windows 7 users, the third pane in the image will not be available on your machine and you will need to paste the path by clicking twice on the path option to edit it. Next, you must direct your cursor to the end of the text on the section, add a semi-colon, and paste the copied path.

Step 4

The fourth step finally adds the copied path. Ensure that you are focused on the edit environment pane and click on the New option, where you can then paste your path.

This step can be disregarded by Windows 7 users, as they have already pasted their path in Step 3.

After pasting, click OK to close the pane and move to the final step.

Step 5

You will only see two panes again. Go to the environment variable pane and head to the system variables section. Once there, choose the path option again.

Edit the path as instructed in Step 3 if you use Windows 7 or Steps 3 and 4 if you use Windows 8 or 10.

Once everything is done, select OK to close the panes. At this point, you have successfully added the application path to the system environment variables. Now the command line can be used to access your application.



View all Courses

Keep Exploring