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
Answer
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.
No comments:
Post a Comment