This is specific to the Pandoc issue you have on Windows. Some might think that this is a bit of a hack. I assume that you have RStudio + R installed on all PC, including the ones you run your batch scripts on.
RStudio comes bundled with Pandoc and adds a few environment variables that are not in a pure R session. You can use
Sys.getenv() to see which variables are added in a RStudio session and compare this to a pure R session.
If you save your specific
RSTUDIO_PANDOC path as
MY_RSTUDIO_PANDOC in a
.Renviron file, then you can write you own function to render the Rmd file. In your render function you set the
Sys.setenv("RSTUDIO_PANDOC" = Sys.getenv("MY_RSTUDIO_PANDOC")) and then you'll will use the Pandoc bundled with RStudio when the
rmarkdown::render function is called, and you won't have a need to install pandoc separately. The env var should of course be added by all who are running the function, including the server/PC running the batch jobs.