title: Running a Windows executable file from within R with command line options
body: <p>I am trying to call a Windows program called <a href="http://chemdata.nist.gov/mass-spc/amdis/downloads/" rel="nofollow noreferrer">AMDIS</a> from within R using the call</p>
  
  <pre><code>system("C:/NIST08/AMDIS32/AMDIS_32.exe /S C:/Users/Ento/Documents/GCMS/test_cataglyphis_iberica/queens/CI23_Q_120828_01.CDF")
  </code></pre>
  
  <p>in order to carry out an analysis (specified using the <code>/S</code> switch) on a file called <code>CI23_Q_120828_01.CDF</code>, but it seems that no matter what I try the file is not loaded in correctly, presumably because the options are not passed along. Does anyone have a clue what I might be doing wrong? </p>
  
  <p>Right now this command either  </p>
  
  <ol>
  <li>doesn't do anything,</li>
  <li>makes AMDIS pop up, but it doesn't load the file I specify </li>
  <li><p>gives me the error</p>
  
  <p>Warning message:</p></li>
  </ol>
  
  <blockquote>
    <p>running command 'C:/NIST08/AMDIS32/AMDIS_32.exe /S
    C:/Users/Ento/Documents/GCMS/test_cataglyphis_iberica/queens/CI23_Q_120828_01.CDF'
    had status 65535</p>
  </blockquote>
  
  <p>(I have no idea what results in these different outcomes of the same command)</p>
  
  <p>(the AMDIS command line options are described <a href="http://littlemsandsailing.files.wordpress.com/2011/05/detailed_instructions.pdf" rel="nofollow noreferrer">here</a> at the page 8)</p>
  
  <p>Cheers,<br>
  Tom</p>
  
  <p>EDIT:<br>
  Found it had to do with forward vs backslashes - running</p>
  
  <pre><code>system("C:\\NIST08\\AMDIS32\\AMDIS_32.EXE C:\\Users\\Ento\\Documents\\GCMS\\test_cataglyphis_iberica\\queens\\CI23_Q_120828_01.CDF /S /E")
  </code></pre>
  
  <p>seems to work - thank you all for the suggestions!</p>