title: Running command prompt from R when running R from command prompt
body: <p>I am running an R script on the command prompt like this:</p>
  
  <p><code>&gt; "R.exe" CMD BATCH --vanilla --slave "myscript.R"</code></p>
  
  <p>The code runs fine in RStudio,  but when I run it from command prompt, it stops running after a certain line of code. What's interesting is that the last line that works is a line that itself calls command prompt: </p>
  
  <p><code>system("cmd /K my_exe_file")</code></p>
  
  <p>That line actually runs successfully, but then the next line doesn't run. There's no error message. Instead, it keeps appearing on command prompt as if the R code is running indefinitely, but in reality nothing is happening.
  Is there a problem with calling command prompt when running R from command prompt? Or is there a different issue I'm missing?</p>