Start up a gitbash or a windows cmd session and run

echo $PATH


echo %PATH%

They both print the contents of the system PATH variable, but neither prints the contents of the PATH variable specific to my user account. For reference, here is the output of echo $PATH in git bash:

/c/Users/Chiel.tenBrinke/bin:/mingw64/bin:/usr/local/bin:/usr/bin:/bin:/mingw64/bin:/usr/bin:/c/Users/Chiel.tenBrinke/bin:/c/Program Files (x86)/Intel/iCLS Client:/c/Program Files/Intel/iCLS Client:/c/Windows/system32:/c/Windows:/c/Windows/System32/Wbem:/c/Windows/System32/WindowsPowerShell/v1.0:/c/Program Files/ThinkPad/Bluetooth Software:/c/Program Files/ThinkPad/Bluetooth Software/syswow64:/c/Program Files/Intel/Intel(R) Management Engine Components/DAL:/c/Program Files/Intel/Intel(R) Management Engine Components/IPT:/c/Program Files (x86)/Intel/Intel(R) Management Engine Components/DAL:/c/Program Files (x86)/Intel/Intel(R) Management Engine Components/IPT:/c/Program Files (x86)/Intel/OpenCL SDK/2.0/bin/x86:/c/Program Files (x86)/Intel/OpenCL SDK/2.0/bin/x64:/c/Program Files/Common Files/Lenovo:/c/SWTOOLS/ReadyApps:/c/Program Files (x86)/Common Files/Lenovo:/c/Program Files/Intel/WiFi/bin:/c/Program Files/Common Files/Intel/WirelessCommon:/c/Program Files/Symantec.cloud/PlatformAgent:/c/Program Files (x86)/Windows Kits/8.1/Windows Performance Toolkit:/c/Program Files/Microsoft SQL Server/110/Tools/Binn:/c/Program Files (x86)/Microsoft SQL Server/100/Tools/Binn:/c/Program Files/Microsoft SQL Server/100/Tools/Binn:/c/Program Files/Microsoft SQL Server/100/DTS/Binn:/c/Program Files (x86)/Microsoft SDKs/TypeScript/1.0:/c/Program Files/Microsoft SQL Server/120/Tools/Binn:/c/Program Files/Microsoft/Web Platform Installer:/c/Program Files (x86)/IBM/Personal Communications:/c/Program Files (x86)/IBM/Trace Facility:/c/Program Files/7-Zip:/c/Program Files (x86)/Gource/cmd:/c/Program Files (x86)/LLVM/bin:/c/Program Files/Perforce:/c/Program Files/Perforce/DVCS:/c/Users/Chiel.tenBrinke/.dnx/bin:/c/Program Files/Microsoft DNX/Dnvm:/c/Program Files/nodejs:/c/ProgramData/chocolatey/bin:/c/Program Files/Microsoft SQL Server/130/Tools/Binn:/c/Go/bin:/c/Users/Chiel.tenBrinke/bin:/c/Program Files (x86)/Python 3.5/Scripts:/c/Program Files (x86)/Python 3.5:/c/ProgramData/Oracle/Java/javapath:/c/Program Files/Python 3.5/Scripts:/c/Program Files/Python 3.5:

Just to clarify the difference between the system PATH and the user PATH, this screenshot shows the panel that lets you edit user variables and system variables, and that's the difference I'm referring to:


As requested, here is the content of the user PATH:

C:\Ruby22-x64\bin;C:\Users\Chiel.tenBrinke\bin;C:\Program Files (x86)\CMake\bin;C:\Users\Chiel.tenBrinke\AppData\Local\Pandoc\;C:\Users\Chiel.tenBrinke\luacheck\bin;C:\Windows\Microsoft.NET\Framework64\v4.0.30319;C:\Users\Chiel.tenBrinke\AppData\Roaming\npm;C:\Users\Chiel.tenBrinke\.babun;C:\Users\Chiel.tenBrinke\.gem\ruby\2.2.0\bin;C:\Program Files (x86)\ChucK\bin

and the system PATH:

C:\Program Files (x86)\Intel\iCLS Client\;C:\Program Files\Intel\iCLS Client\;C:\Windows\system32;C:\Windows;C:\Windows\System32\Wbem;C:\Windows\System32\WindowsPowerShell\v1.0\;C:\Program Files\ThinkPad\Bluetooth Software\;C:\Program Files\ThinkPad\Bluetooth Software\syswow64;C:\Program Files\Intel\Intel(R) Management Engine Components\DAL;C:\Program Files\Intel\Intel(R) Management Engine Components\IPT;C:\Program Files (x86)\Intel\Intel(R) Management Engine Components\DAL;C:\Program Files (x86)\Intel\Intel(R) Management Engine Components\IPT;C:\Program Files (x86)\Intel\OpenCL SDK\2.0\bin\x86;C:\Program Files (x86)\Intel\OpenCL SDK\2.0\bin\x64;C:\Program Files\Common Files\Lenovo;C:\SWTOOLS\ReadyApps;C:\Program Files (x86)\Common Files\Lenovo;C:\Program Files\Intel\WiFi\bin\;C:\Program Files\Common Files\Intel\WirelessCommon\;C:\Program Files\Symantec.cloud\PlatformAgent\;C:\Program Files (x86)\Windows Kits\8.1\Windows Performance Toolkit\;C:\Program Files\Microsoft SQL Server\110\Tools\Binn\;c:\Program Files (x86)\Microsoft SQL Server\100\Tools\Binn\;c:\Program Files\Microsoft SQL Server\100\Tools\Binn\;c:\Program Files\Microsoft SQL Server\100\DTS\Binn\;C:\Program Files (x86)\Microsoft SDKs\TypeScript\1.0\;C:\Program Files\Microsoft SQL Server\120\Tools\Binn\;C:\Program Files\Microsoft\Web Platform Installer\;C:\Program Files (x86)\IBM\Personal Communications\;C:\Program Files (x86)\IBM\Trace Facility\;C:\Program Files\7-Zip;C:\Program Files (x86)\Gource\cmd;C:\Program Files (x86)\LLVM\bin;C:\Program Files\Perforce;C:\Program Files\Perforce\DVCS\;C:\Users\Chiel.tenBrinke\.dnx\bin;C:\Program Files\Microsoft DNX\Dnvm\;C:\Program Files\nodejs\;C:\ProgramData\chocolatey\bin;C:\Program Files\Microsoft SQL Server\130\Tools\Binn\;C:\Go\bin;C:\Users\Chiel.tenBrinke\bin;C:\Program Files (x86)\Python 3.5\Scripts\;C:\Program Files (x86)\Python 3.5\;C:\ProgramData\Oracle\Java\javapath;C:\Program Files\Python 3.5\Scripts\;C:\Program Files\Python 3.5\;C:\Program Files\Git\cmd

How can I make sure that my user PATH variable is taken into account as well in the cmd and the git bash?

  • 2
    Please edit the question and include the compete text from both the user path and the system path. – DavidPostill Apr 18 '16 at 13:58
  • Question updated. – Chiel ten Brinke Apr 18 '16 at 14:17

How can I make sure that my user PATH variable is taken into account.

Your problem is that your system path is currently too long (2000 characters). Fixing this should also fix your bash path as this is usually based on the Windows path.

You can:

  • Shorten your system path to < 1920 characters, or

  • Add the user path values to the system path.

Does echo %PATH% expand to only the system or also the user variables?

Found out that on Windows Server 2003, once the system PATH passes 1920 characters, the user PATH environment variable is no longer merged with it to set the process PATH environment variable, even though the full system PATH (even if larger) will be included in the process PATH variable.

Source Does echo %PATH% expand to only the system or also the user variables? answer by David Heffernan

| improve this answer | |
  • Any suggestions on how to cut down the length of the path? I suppose removing random entries will break things. – Chiel ten Brinke Apr 18 '16 at 16:30
  • Do you need all 3 ...\100\Tools\Binn\, ...\110\Tools\Binn\, ...\120\Tools\Binn\ entries? Are they not different versions of the same thing? Windows will use the program it finds first in the path ... – DavidPostill Apr 18 '16 at 16:36
  • I suppose so, but I'm not sure. I might just try to remove some and back it up for restore when something goes wrong in the future. Another tip: move some of the more personal entries to the user path. – Chiel ten Brinke Apr 18 '16 at 16:48

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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