:Matlab2009bSP1
if "%USEDBits%"=="32" (
REM ---- 32bit
for /f "tokens=3 delims= " %%i IN ('reg query HKLM\SOFTWARE\WOW6432NODE\Mathworks\Matlab\7.9.1 /v MATLABROOT') do (SET Matlab_x32=%%i)
REM -- Split the result into MATLABROOT, REG_SZ and Folder using space as delimiter
REM for /f "tokens=1,2,3 delims= " %%a in ("%MATLAB_ROOT_32%") do set useless1=%%a&set useless2=%%b&set MATLAB_x32=%%c
REM ---- 64bit
) else (
for /f "tokens=3 delims= " %%i IN ('reg query HKLM\SOFTWARE\WOW6432NODE\Mathworks\Matlab\7.9.1 /v MATLABROOT') do (SET Matlab_x32=%%i)
for /F "tokens=3*" %%i IN ('reg.exe query HKLM\SOFTWARE\Mathworks\Matlab\7.9.1 /v MATLABROOT') do (SET Matlab_x64=%%i))
REM -- Split the result into MATLABROOT, REG_SZ and Folder using space as delimiter
REM for /f "tokens=1,2,3 delims= " %%a in ("%MATLAB_ROOT_64%") do set useless1=%%a&set useless2=%%b&set MATLAB_x64=%%c
echo 32 %Matlab_x32%
echo 64 %Matlab_x64%
if %Matlab_x32%==%Matlab_x64% (
set Matlab_x64=C:\app\Matlab\R2009bSP1x64
)
GOTO Compiler_Wahl