Closed DavisBrian closed 6 years ago
What is this Path on your environment? file.path(Sys.getenv("R_HOME"), "bin", "Rscript.exe")
"//vfhomefls01/bdavis07/my documents/R/R-3.4.4/bin/Rscript.exe"
Can you use the Rexe argument when you do taskscheduler_create
where you pass Rexe = shQuote(file.path(Sys.getenv("R_HOME"), "bin", "Rscript.exe"))
Do you have any feedback on this solution?
I'll see if I can verify today.
Doesn't seem to fix it.
'//vfhomefls01/bdavis07/my' is not recognized as an internal or external command, operable program or batch file.'
code
## Run script once at a specific timepoint (within 62 seconds)
runon <- format(Sys.time() + 62, "%H:%M")
taskscheduler_create(taskname = "quicktest", rscript = "H:/tmp/helloworld.R",
shQuote(file.path(Sys.getenv("R_HOME"), "bin", "Rscript.exe")),
schedule = "ONCE", starttime = runon)
## Have a look at the log
mylog <- system.file("extdata", "helloworld.log", package = "taskscheduleR")
cat(readLines(mylog), sep = "\n")```
This doesnt look like you passed the Rexe argument
That seems to have done the trick.
If it worked, feel free to close the issue.
interesting is I think I now have a similar issue to #33 now on my actual script. The command window pops up when the task is triggered but no log or output occurs. TaskScheduler says the job completed successfully, but the runt ime is 1 second and I know the script takes about 5 minutes to run. I'll close this and see if I can make a reprex for the new issue.
the easy solution to your problem is to put R in a folder without spaces instead of on the location whare you have it now //vfhomefls01/bdavis07/my documents/R/R-3.4.4/bin/Rscript.exe
which seems to be a shared drive. Why don't you just copy //vfhomefls01/bdavis07/my documents/R
to //vfhomefls01/bdavis07/R
This will be very hard to reproduce without having a similar shared drive.
Corporate IT department, don't have options one normally has.
This is similar to issue #10.
If your R installation location has a space it your script will also fail. For a lot of corporate users we don't have a say as to where R gets installed.
Here we have \\\R.
All scripts built with taskscheduleR fail with
'///<directory' is not recognized as an internal or external command,
operable program or batch file.