Tag: Execute CMD command from R

  • Execute Windows CMD command (PowerShell) from R script

    Execute Windows CMD command (PowerShell) from R script

    Here is an example of how to execute the Windows CMD command or PowerShell from R script. You can run cmd.exe by using the system function, and input might be something that you can run in CMD.

  • How to run Windows batch file from R script

    For me, it worked like this, but there is also modification needed in the actual batch file. system(“cmd.exe”, input = paste(‘C:\\This\\Is\\Path\\Your.bat’)) In the batch file, I added exit command at the end because that was running in an endless loop.   On the other hand, endless loops with proper timing and conditions in the batch…