title: Run .bat file using shell() in R
body: <p>I'm using the console of PDFSam to split and merge some PDF files. I can do this semi-automatically using .bat files, but I would like to do the whole thing in R. </p>
  
  <p>This code in my .bat file works:</p>
  
  <pre><code>C:
  cd "/Program Files/pdfsam/bin/"
  run-console.bat -f "d:/delete/A_9.pdf" -o d:/delete -s BURST -overwrite split
  </code></pre>
  
  <p>But this "equivalent" code in my R shell command returns no errors, but doesn't seem to work. </p>
  
  <pre><code>shell('C: 
  cd "/Program Files/pdfsam/bin/"
  run-console.bat -f "d:/delete/A_9.pdf" -o d:/delete -s BURST -overwrite split')
  </code></pre>
  
  <p>Is there an option I'm missing in my shell command? I've tried a few of the options listed in ?shell to no avail.</p>
  
  <p>I'm using windows XP and 
  R version 2.13.1 (2011-07-08)
  Platform: i386-pc-mingw32/i386 (32-bit)</p>
  
  <p>Thanks,
  Tom</p>