Because there are probably other folks who may think I've not examined this issue in sufficient depth consider this code:
:: Set the ERTS dir from erl
:set_erts_dir_from_erl
@for /f "delims=" %%i in ('where erl') do @(
set erl=%%i
)
@set dir_cmd="%erl%" -noshell -eval "io:format(\"~s\", [filename:nativename(code:root_dir())])." -s init stop
@for /f %%i in ('%%dir_cmd%%') do @(
set erl_root=%%i
)
@set erts_dir=%erl_root%\erts-%erts_vsn%
@set rootdir=%erl_root%
@goto :eof
And here's the relevant environment variables after I run this:
C:\Users\ocatenacci>set erts_dir
erts_dir=c:\Program\erts-
C:\Users\ocatenacci>set erl_root
erl_root=c:\Program
C:\Users\ocatenacci>set rootdir
rootdir=c:\Program
You'll note that because erl_root isn't set right the other environment variables are also wrong. So the simple answer would seem to be on the line set erl_root=%%i make it set erl_root="%%i" instead. That would seem to be the simple answer but it would be wrong. Here's the result after I make that modification:
C:\Users\ocatenacci>set erts_dir
erts_dir="c:\Program"\erts-
C:\Users\ocatenacci>set erl_root
erl_root="c:\Program"
C:\Users\ocatenacci>set rootdir
rootdir="c:\Program"
Mind you that snippet of batch file I put in my e-mail is from an older version of the EXRM source. It's not as if Paul and I haven't struggled to fix this and get it working right. It's just that quoting those directories is error prone and it seems to be hard to get right. I've been over and over this question and I'm convinced that the only consistent, practical way to fix this issue is to convert all the directories to the 8.3 version. That's why I took the time to create that Pragmatic code--because I'm tired of trying to figure out what to quote where.
--
Onorio