title: Run older version of MATLAB in batch file
body: <p>There are two versions of MATLABs (2007a and 2019a) installed on my computer. The 2019a is installed after 2007a so if you use the following code in batch file: </p>
  
  <pre><code>start matlab -r "xxx.m"
  </code></pre>
  
  <p>The system will call 2019a instead of 2007a. </p>
  
  <p>I searched online and found that most of people say you can call older version by: </p>
  
  <pre><code>start "C:\Program Files (x86)\MATLAB\2007a\bin\win32\MATLAB.exe" -r "xxx.m"
  </code></pre>
  
  <p>I tried but it give me this error:
  <a href="https://i.stack.imgur.com/Sm3Ft.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/Sm3Ft.png" alt="error message"></a></p>
  
  <p>if the batch file doesn't include any command ("-r" etc.), it works just fine. MATLAB can be opened without problems.</p>
  
  <p>What's the mistake I made? How could I call older version and have it run some functions? </p>
  
  <p>My OS: Win7 </p>