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.

I installed Cygwin on my Windows XP machine. How can I add c:\cygwin\bin to the %PATH% in such a way that it persists?

My autoexec.bat is empty, and I assume it's no longer the right place for that. Where's the best place to do this?

share|improve this question

2 Answers 2

up vote 12 down vote accepted

Right click on my computer and select properties. In the Advanced tab, there is a button called Environment Variables. The PATH variable is in there, just add a semicolon and then the cygwin path to the end of the existing value, so it looks like this:

C:\WINDOWS\system32;C:\WINDOWS\;C:\WINDOWS\System32\Wbem;...;c:\cygwin\bin
share|improve this answer
2  
It's the Advanced tab. –  random Aug 22 '09 at 7:35
    
Thx I just went blank on that and haven't got my windows pc switched on. –  Col Aug 22 '09 at 7:48
    
You can also get to the Environment Variables by searching for "path" in the Start Menu. –  Austin Moore Jul 14 at 15:00

To add to your user profile path you can do the following from the command line using the setx command which is built into Windows Vista and above. In earlier versions of Windows you can use the Windows Resource Kit to get it.

Say Cygwin in installed in c:\cygwin, do:

SETX path c:\cygwin;c:\cygwin\bin;%path%

Or for you, as user only:

SETX -m path c:\cygwin;c:\cygwin\bin;%path%
share|improve this answer
    
It's probably better practice to add to the end of the existing path, not the start. If there are conflicts you probably want the original Windows binaries to run, to prevent issues with other programs that expect that. –  Bob Oct 21 '12 at 3:02
    
Actually @bob in case I disagree. Cygwin is a environment on top of windows (essentially a shell), in this case I think it would be better to run the windows binaries second. In the case of other programs that are non 'replacing windows behaviours' then your suggestion hold water. –  Preet Sangha Oct 21 '12 at 7:05
    
If you want to run cygwin binaries before Windows executables within the cygwin shell, you could modify the path in cygwin's .bashrc. I personally consider it safer to keep Windows' own binaries at the beginning of the path for any other Windows applications or tools, to reduce possible issues from conflicts. But that's the user's choice, in the end. –  Bob Oct 21 '12 at 7:24

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

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