I recently discovered that Windows does something funny when the path variable gets too big. (Here I mean that PATH variable + the user PATH variable).
The funny thing is that it seems to permute the string somehow because after adding/removing an extra string Windows and all new cmd’s would loose all knowledge of the PATH variable until next reboot. Then after reboot it comes back to life again.
An interesting observation was to see how windows uses the path variable internally, and that is for opening the dialogue where you change the PATH variable 🙁
I found an approach that shortened the path enough for me here
Basically I converted the path to the short 8dot3 format with this script:
@echo off SET MyPath=%PATH% echo %MyPath% echo -- setlocal EnableDelayedExpansion SET TempPath="%MyPath:;=";"%" SET var= FOR %%a IN (%TempPath%) DO ( IF exist %%~sa ( SET "var=!var!;%%~sa ) ELSE ( echo %%a does not exist ) ) echo -- echo !var:~1!