Take the 2-minute tour ×
Super User is a question and answer site for computer enthusiasts and power users. It's 100% free, no registration required.

Possible Duplicate:
How do I set PATH and other environment variables?

How can one set the path permanently in command-prompt. I tried using the following code :-

set path=%path%;C:\python27

It works but only until the command prompt runs. When I exit and restart, the path returns to its earlier state.

Please tell me how can I set the command path permanently in Windows 7 command prompt.

share|improve this question

marked as duplicate by slhck, Ƭᴇcʜιᴇ007, random Aug 1 '11 at 14:19

This question has been asked before and already has an answer. If those answers do not fully address your question, please ask a new question.

    
The answers below are correct. What you did did not make the variable persistent. –  KCotreau Aug 1 '11 at 12:46
    
@slhck: In general: Yes, you are right. However the other question was about all majors OS and thus the answer is really long. What this user was seeking is in one sentence in the last 1/3 of the answer and titled Windows NT. I'm not sure if a normal user knows that Windows 7 = NT 6.1. –  TeX HeX Aug 1 '11 at 12:56
    
@TeX Actually it's in the first answer, in the part where it says Windows - GUI or Command Line. –  slhck Aug 1 '11 at 13:00
    
@slhck:Woops, overlooked that. You are right. +1. –  TeX HeX Aug 1 '11 at 13:03

2 Answers 2

up vote 10 down vote accepted

From the Start Menu, right-click Computer on the right side. In the appearing window, select Advanced system settings in the left area - the System properties will appear. Select Environment Variables... at the bottom.

Change the Path variable there and it will be always active.

share|improve this answer
10  
While this is the accepted answer, it doesn't explain how to do it from the command prompt. For reference, this is done using the setx command (as explained in the duplicated question linked above) –  Luke Jan 9 '13 at 23:26
4  
For further reference (as I keep coming back here whenever I need to do this), the command is setx path "%path%;c:\newpath" and this works without admin rights. –  Luke Feb 7 '13 at 3:05
1  
SystemPropertiesAdvanced.exe brings you to the menu to revise your path. –  class Feb 27 at 4:45

You need to do the following:

  1. Go to Control Panel --> System and Security --> System
  2. Click Advanced system settings
  3. Click Environment Variables
  4. In the System Variables area, locate the Path variable, highlight it and click Edit...
  5. Make the required changes, Click OK, OK, OK

That will save your changes permanently.

share|improve this answer

Not the answer you're looking for? Browse other questions tagged or ask your own question.