Modifying the Path environment variable is not working

13,593

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:
13,593

Related videos on Youtube

Morgan Herlocker
Author by

Morgan Herlocker

Updated on September 18, 2022

Comments

  • Morgan Herlocker
    Morgan Herlocker almost 2 years

    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
    
    • Canadian Luke
      Canadian Luke almost 12 years
      Can you post the result of your echo %PATH%?
  • Morgan Herlocker
    Morgan Herlocker almost 12 years
    No, my output is the same, unfortunately.
  • Dennis
    Dennis almost 12 years
    @MorganHerlocker See my edit.
  • Morgan Herlocker
    Morgan Herlocker almost 12 years
    Wow, thanks! Idk if I ever would have figured that out.