When MCC is invoked from batch file or from system prompt, it invokes mcc.bat as opposed to mcc.exe(from MATLAB). You can verify by checking "where mcc" on your system prompt, you will see it gets from mcc.bat.
So in that case, there is a batch file calling another batch file when MCC is called like in the example. Usually when batch file calls another batch file directly like in the example, they don't handle back the control to the called batch file. Thus one will see the behavior we observed. In that case, one can use CALL on the BATCH file one is calling inside the batch file. For example, the example code can be changed like below and one will observe changes:
echo Start compiling
call mcc -m test.m -v
echo Compiling done
pause
Best Answer