How to set the path and Environment Variable in Windows

System Path and Environment Variables

In this tutorial, we will learn that how to add any program or application in system path or environment variable. There are much reason to add the program or application in system path environment variables like if we want to run the program from the command line either we are in other directory or the same directory where the program executable file exist. For example, if I want to run my Python program file from the command line only just writing the name of my Python program file name, e.g., I have a written a program called first.py in python, and I save it in C:\myprogram, another directory than Python installed directory. But I want to run so there are two way to run that, first, I will give my Python installed directory and the file name that I want to run, second method is that only once I will add Python installed directory into the system environment variable path then only I will write the program name and extension then press enter to run.

So let’s start to add in the system path.

Step No. 01:  Go the program directory which you want to add in the system path, in my case I want to add Python interpreter into system path. Find the .exe file of your program or application then only copy path just clicking on address bar copy it follows the next step.

Step No. 02:  Follow the below steps.

  1. Computer property. Right click on your computer icon.
  2. Click on Properties.
  3. Click on Advanced system settings
  4. Click on Advance tab. Now you will see a new window dialog box. Click on Advance Tab
  5. Click on Environment Variables…

After clicking Environment Variables… a window will appear

  1. Click on Path. Because we want to add the program into system path.
  2. Click on Edit…

A new window will appear.

  1. Click on the new button. Because we want to add our path.
  2. Paste the copied path into the field. In my case, I have copied Python interpreter path.
  3. Click OK, Click OK, Click OK, Close the window.

Now open your command line window and then type python.

  1. This indicates that I have successfully added my python interpreter into the system path environment variables…

So in this way you can add any program in system path environment variable. I have to add my PHP, MySQL, Sublime Text, C Sharp compiler and many other program and application into my system environment variable so that I can work quickly and efficiently….