MATLAB: The external program fails to run in batch mode from MATLAB. NOT RECOGNIZED error

runing an external program

Hello everybody I am trying to run CFX in batch mode from MATLAB. When I type !<path>\cfx5pre.exe it works fine but when I add -batch at the end of this command, MATLAB returns the error 'D:\Program' is not recognized as an internal or external command,operable program or batch file

Best Answer

When you construct the command line, put double quotes " around the path. Otherwise because there's a space in "C:/program files/......" it sees it as 2 (or more) separate arguments.