I have a query and I want to execute it on the two first days of the month and this happens every month. I used the following code but I received an error:
taskscheduler_create(taskname = "test", rscript = "C:/Users/Public/TaskScheduler/test.R", schedule = "MONTHLY", startdate = format(as.Date("2021-02-16"), "%m/%d/%Y"), starttime = "15:22", days =c(1:2))
This is the error:
[1] "ERROR: Invalid value for /D option." "Type \"SCHTASKS /CREATE /?\" for usage."
attr(,"status") [1] 16389
I am also aware of task_scheduler addon but I prefer writing a code for it.