0

I have a .bat file that works great to detect if Rscript.exe is running, and if not it will launch a specific Rscript file. Below is the code, which was inspired by this SO Q&A Batch program to to check if process exists:

cd C:\R\Scripts
tasklist | find /i "Rscript.exe" && echo process "Rscript.exe" is running. || 
"C:\Program Files\R\R-3.4.1\bin\x64\Rscript.exe" 
"C:\R\Script_1.R"

However, as opposed to simply checking if the Rscript.exe process itself is running, I want to detect if Rscript.exe is running the specific Script_1.R file. This way, I can have individual .bat files for each R script file. I wouldn't want to run all the scripts from one .bat file because I wouldn't want to relaunch all the scripts, just the scripts which aren't currently running.

sshemtov
  • 13
  • 5

0 Answers0