title: Set working directory to mapped network drive in BATCH mode
body: <p>I'm having issues on windows with R failing when changing the working directory to a mapped network drive (e.g. \Share\Folder mapped to Z:) in batch mode.  If I run the same script in an interactive console I don't have any issues.  I am accomplishing this by running R.exe with the script specified inside of a windows batch (.bat) file.  The .bat file contains the following.</p>
  
  <pre><code>"C:\RRO\R-3.2.1\bin\R.exe" CMD BATCH "C:/Scripts/Rscript.R"
  </code></pre>
  
  <p>The error is simply...</p>
  
  <pre><code>&gt; setwd( 'Z:/' ) 
   Error in setwd("Z:/") : cannot change working directory
  </code></pre>
  
  <p>I'd be open to a different approach entirely for scheduling these scripts via the windows task scheduler if that helps avoid the issue.  The reason for mapping the drive is that I need to supply some credentials in order to access it, which is done automatically when it is mapped, but can test to see if that's not the case in R if anyone knows how.</p>