If you are a geek who has experience in Linux, you would know exactly what I’m talking about. If not, Environment Variables are a set of predefined variables that make system functional properly. The same also applies to Windows, though, as a regular user, you don’t need to worry about them.
Recently, I was looking at some Android documentation and trying to set up a development environment on my Windows 7. One of the steps is to add a directory path to the PATH environment variable. I had to admit that Google didn’t put much effort into the documentation to make us go through it easily.
To install the SDK, simply unpack the starter package to a safe location and then add the location to your PATH.
No explanation on how to do this.
So how exactly are you going to do this?
To add or edit anything environment variables in Windows 7, you need to go to System Properties first.
Then, go to “Advanced system settings”,
Under “Advanced” tab, click on “Environment Variables …” button at the bottom.
Double click PATH and add new path into the “variable value”. Make sure you separate the value with “; “
Let’s sum up what we just did
PATH is an environment variable that holds all the executable shell commands. When you type something in the command prompt, it will go through all the path and search for the match of the command line utility name you have just entered.
In short, there are tons other environment variables in Windows, if you are interested in how it works, you can go to Technet documentation and check out.
Thank you for this tips (and this excellent site)!
I guess Google figured that if someone didn’t know what it meant to add a program’s path to a system’s environment, they shouldn’t be a programmer. 😉
If you’re tired of the small cumbersome windows in all Windows versions for Environment Variable editting, check out http://www.rapidee.com. It’s a free environment variable editor that takes advantage of real windows capabilities. I’m a user of the app, not the developer.
Thanks a lot. This was the information I was searching for. Was stuck on to exactly the same thing, while trying to set up my comp for Android app development.
glad it helped out 😛
You can also type sysdm.cpl in the search line of the Windows button and it will bring up the system properties box. Click on the Advanced tab and then select “Environment Variables”. Everything else is the same. A quicker way for us geeks 😉
Can you do this for all users? Like a computer configuration instead of a profile configuration?
hi
thanks useful
Thank you.
Great tutorial. by the way here is the step by step tutorial I follow to edit PATH environment variable in Windows 7 and Windows 8
Thank you. Very clear and concise.
Great tutorial. Thank you greatly
should there be a semicolon at the end of the last string
not required
For complete novice – these instructions should probably include that to get to System Properties under Windows 7 and higher, you right-click on “computer” or “my computer” and select properties.
Thank you anon! This was exactly the help I needed! How can they skip this part?!?
where i can found it in regedit.exe
Press (START) focus should be on search box: Type “regedit” your PC will find the app for you, also works quick for CMD or any other app that you want to find fast.
Why i can’t click the “Advanced system settings” ?? I can see this tab on menu but is unclickable tab
You probably don’t have the local admin rights on the computer.
i am getting windows did not find %windir% like that….make sure you are giving correct
Great tutorial.
In my opinion windows 7 is the best of all th times.
it is king
Hello, Johnatan!
I have a question: do I need to restart the computer after changing an environmental variable’s value?
Because sometimes, after changing it, the programs using these values don’t recognize the change.
No, I don’t think you need to. It takes effect right away.
how to set environmental variables for metasploit
My aim: add a PATH to and ordinary user “user1”.
I login as an ordinary user “user1”, then I select “advanced system settings” (it asks for admin password which I gave) as per the first screenshot, and the select “Environment variables” as per second screenshot and it shows “user variables for admin” where it is showing “i823332” in your 3rd screenshot. any idea why?
I don’t want to change anything for admin. just want to add a PATH to “user1”.