I have a scheduled task (using SCHTASKS
) to run every minute.
SCHTASKS /Create /SC MINUTE /MO 1 /TN READSCALE /TR "Rcmd BATCH --vanilla --slave q:\workspace\waga\readScale.R"
On each run command prompt window pops up. It's slightly irritating and perhaps a potential health hazard for people with epilepsy. In Java, one can use javaw.exe
(see this thread) that doesn't pop up a command prompt. Is there an equivalent for R?
Here's the steps: Download R from R Project and install into the shared drive. Open the .exe file found in the file path you just installed into, the file path will start with the R version you just downloaded and end with /bin/R.exe. Now that you have R running, install all of the packages your scripts need.
To open up the command prompt, just press the windows key and search for cmd. When R is installed, it comes with a utility called Rscript. This allows you to run R commands from the command line.
Kudos to serverfault.com, where some people solved the problem using no external tools at least in two ways. Here's the thread.
First is to write a .vbs script. This requires some knowledge of this scripting language and may not be appropriate for everyone.
The second method is to run the task (as I'm doing) under SYSTEM (and not the currently logged in user).
Ah, Windows... There is a tool called hstart which may help here.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With