I have created an r script which saved down an excel file and sends it attached to an email.
I create a batch-file to automate the process so that it can be run each Sunday:
@echo off
set JAVA_HOME = "C:\Program Files\Java\jre1.8.0_151"
"C:\Program Files\R\R-3.4.3\bin\x64\Rscript.exe" Report.r -multiwindow
exit /B
Then, I create the task in the Task Scheduler.
In the security options at the General tab I check Run whether user is logged on or not - Run with highest privileges
.
In Triggers, I add a new trigger
and I check Weekly
, and Advanced settings
, Enabled
. In Actions
, I browse the .bat
file and I save the task.
When I click Run, nothing happens, but it does say Task completed, despite both the R script and batch file runnnig fine outside of the scheduled task.
Any ideas?