title: Run a MATLAB script from Windows DOS prompt
body: <p>I am trying to run a Matlab script from Windows command prompt but I can't execute it sometimes.  The script runs fine when manually launched.  Matlab version is 2011a and Windows is Server 2003 SP2.  Details:</p>
  
  <p>Script <code>mytask.m</code> is located inside say <code>E:\Production\Project</code>.  This is <code>SAVED</code> on Matlab's path.</p>
  
  <p>When I place mytask.m inside <code>bin</code> folder, it executes fine by the command:</p>
  
  <pre><code>     `C:\Program Files\MATLAB\R2011a\bin&gt;matlab -r mytask`
  </code></pre>
  
  <p>If you delete it and try to access it at its original location, the script doesn't run although Matlab editor window is launched:</p>
  
  <pre><code>     `C:\Program Files\MATLAB\R2011a\bin&gt;matlab -r "E:\Production\Project\mytask"
  </code></pre>
  
  <p>Any suggestions please?  Thanks.</p>