At first , I'm not sure if the syntax has changed, but I have to call the script without the .m 'file extension:
matlab.exe -nosplash -nodesktop -nojvm -wait -r printToCommandLine
Otherwise, I will get an error in MATLAB.
Second , it just works, but you can print the current command line output into a log file, for example. 'log.txt' with
matlab.exe -nosplash -nodesktop -nojvm -wait -logfile "log.txt" -r printToCommandLine
The log file will be updated at run time. To test this, I created a small example script and looked at how "log.txt" changes at runtime:
disp('Script execution started. Waiting 10 seconds...') pause(10) disp('...waited 10 seconds.');
This is not quite what you wanted, but it gives you the opportunity to get actual information about the current command line output at run time (in a text file).
We use this for automated (remote) testing, to print the output of the MATLAB command line to the console after the tests passed using
type log.txt
source share