title: Using WebDav & RoboCopy to copy docs between Document Libraries
body: <p>I am trying to automate the process of copying documents between SharePoint 2013 document libraries using a RoboCopy job which calls WebDav.</p>
  
  <p>Batch only works if first manual connection operation was conducted on the intranet. As long as the user's session is active, does it work .</p>
  
  <p>This is the command I am running:</p>
  
  <pre><code>robocopy "Source" "Destination" "Log File" /MOV
  </code></pre>
  
  <p>And these are the error messages I'm receiving:</p>
  
  <blockquote>
    <p>-Exception Message :Access Denied. Before opening files in this location, you must first add the web site to your trusted sites list, browse to the web site, and select the option to login automatically.</p>
    
    <ul>
    <li>StackTrace : at system.IO.__Error.WinIOError(Int32, errorCode, String maybeFullPath)</li>
    <li>at system.IO.Directory.InternalCreateDirectory(String fullPath, String Path, Object dirSecurityObj, Boolean checkHost)</li>
    <li>at system.IO.Directory.InternalCreateDirectoryHelper(String Path, Boolean checkHost)</li>
    <li>at system.IO.Directory.CreateDirectory(String Path)**</li>
    </ul>
  </blockquote>
  
  <p>Any ideas how this can be done?</p>