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 have my PATH variable set on my Windows 7 machine, and everything appears normal when I do

echo %Path%

The paths look fine and are separated by ";" like normal, however, when I try to run any custom command executables (like git), I get something like

'git' is not recognized as an internal or external command, operable program or batch file.

This happens even though my Path variable shows C:\Program Files (x86)\Git\bin; as one of the paths. If I run the exe from Windows Explorer, it runs just fine. Also, I have tried restarting the cmd and doing a full reboot with the same result. What could be the cause of this?

here is the result of echo %Path%:

C:\Windows\system32;C:\Windows;C:\Windows\system32\Wbem;C:\Windows\system32\WindowsPowerShell\v1.0\; C:\Program Files (x86)\OpenSSH; C:\Python27; C:\Program Files (x86)\nodejs;  C:\Program Files (x86)\Git\bin;  C:\Program Files\Mercurial; C:\Program Files (x86)

And here is what it is actually set to:

 %SystemRoot%\system32\; %SystemRoot%\; %SystemRoot%\System32\Wbem\; %SYSTEMROOT%\System32\WindowsPowerShell\v1.0\;  C:\Program Files (x86)\OpenSSH\bin\;  C:\Python27\;  C:\Program Files (x86)\curl-7.23\;  C:\Program Files (x86)\Git\bin\;  C:\Program Files (x86)\nodejs\;   C:\Program Files (x86)\PHP\;  C:\Program Files\Mercurial
share|improve this question
    
Can you post the result of your echo %PATH%? –  Canadian Luke Aug 3 '12 at 20:08
add comment

1 Answer

up vote 2 down vote accepted

Only ; is used to separate directories in the path name. As a result, every character has to be treated literally.

This includes spaces. Otherwise, it wouldn't be possible to specify directories that end or even begin with a space (the drive letter is optional).

Set your path to

%SystemRoot%\system32\;%SystemRoot%\;%SystemRoot%\System32\Wbem\;%SystemRoot%\System32\WindowsPowerShell\v1.0\;C:\Program Files (x86)\OpenSSH\bin\;C:\Python27\;C:\Program Files (x86)\curl-7.23\;C:\Program Files (x86)\Git\bin\;C:\Program Files (x86)\nodejs\;C:\Program Files (x86)\PHP\;C:\Program Files\Mercurial

and it should work.

share|improve this answer
    
No, my output is the same, unfortunately. –  Morgan Herlocker Aug 3 '12 at 20:25
    
@MorganHerlocker See my edit. –  Dennis Aug 3 '12 at 20:51
    
Wow, thanks! Idk if I ever would have figured that out. –  Morgan Herlocker Aug 6 '12 at 13:26
add comment

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.