-
Notifications
You must be signed in to change notification settings - Fork 347
env.bat and the rest of scripts fail if there are special characters, specifically '&' #716
Description
The env.bat shipped with WinPython failed in my computer. I tracked down the issue to a folder in the PATH variable containing an ampersand (&).
The symptom was spyder and the rest not working, and execution of scripts\env.bat yielded
The system cannot find the path specified
The offending lines are
echo ;%PATH%; | %FINDDIR%\find.exe /C /I ";%WINPYDIR%;" >nul
if %ERRORLEVEL% NEQ 0 set PATH=%WINPYDIR%\Lib\site-packages\PyQt5;%WINPYDIR%\Lib\site-packages\PyQt4;%WINPYDIR%\Lib\site-packages\PySide2;%WINPYDIR%;%WINPYDIR%\DLLs;%WINPYDIR%\Scripts;%WINPYDIR%..\t;%WINPYDIR%..\t\mingw32\bin;%WINPYDIR%..\t\R\bin\i386;%WINPYDIR%..\t\Julia\bin;%WINPYDIR%..\t\n;%PATH%;
Enclosing the PATH variables in double quotes solved the problem, and I believe makes no harm:
echo ";%PATH%;" | %FINDDIR%\find.exe /C /I ";%WINPYDIR%;" >nul
if %ERRORLEVEL% NEQ 0 set PATH="%WINPYDIR%\Lib\site-packages\PyQt5;%WINPYDIR%\Lib\site-packages\PyQt4;%WINPYDIR%\Lib\site-packages\PySide2;%WINPYDIR%;%WINPYDIR%\DLLs;%WINPYDIR%\Scripts;%WINPYDIR%..\t;%WINPYDIR%..\t\mingw32\bin;%WINPYDIR%..\t\R\bin\i386;%WINPYDIR%..\t\Julia\bin;%WINPYDIR%..\t\n;%PATH%;"
An example of a folder name where the problem shows up is:
c:\Program Files (x86)\R&R