title: xcopy and Robocopy deleting destination file
body: <p>I'm trying to copy some files from one server to another's shared folder, the thing is, it works sometimes, but quite often the xcopy and robocopy commands delete the destination file upon failure, even if the backup fails I need the files to stay there.</p>
  <p>To get into details, on the server where I'm running the commands (Windows 10) I have a bunch of Tableau files (.twbx) which are updated via a .JAR file that I run every morning with a Scheduled task.</p>
  <p>After the files are updated I copy them to another server's share using xcopy (I later tried Robocopy to see if the problem stops happening), but when I check in the morning, the destination file is missing. It works sporadically, the issue is I need those files to always be in the share folder.</p>
  <p>My .bat file looks like this:</p>
  <p>I sequentially run the copy commands (one for each file since they are in diferent folder).</p>
  <pre><code>Robocopy E:\Tableau\TableauFileFolder \\shareserver\sharefolder\Tableau\TableauFileFolder TableauFile.twbx /mt /r:0 /log+:E:\Tableau\LogFile.log
  Robocopy E:\Tableau\TableauFileFolder2 \\shareserver\sharefolder\Tableau\TableauFileFolder2 TableauFile2.twbx /mt /r:0 /log+:E:\Tableau\LogFile.log
  Etc...
  </code></pre>
  <p>For xcopy I'm using:</p>
  <pre><code>xcopy /s/y E:\Tableau\TableauFileFolder\TableauFile.twbx \\shareserver\sharefolder\K2BAnalytics\TableauFileFolder
  </code></pre>
  <p>Directory structure is like so, on the server where I'm running the commands I have:</p>
  <pre><code>E:
    |--&gt;Tableau
      |--&gt;ShareFileFolder
        |--&gt;ShareFile.twbx
      |--&gt;ShareFileFolder2
        |--&gt;ShareFile2.twbx
  </code></pre>
  <p>Share server:</p>
  <pre><code>sharefolder:
    |--&gt;Tableau
      |--&gt;ShareFileFolder
        |--&gt;ShareFile.twbx
      |--&gt;ShareFileFolder2
        |--&gt;ShareFile2.twbx
  </code></pre>
  <p>My log file shows this error on the missing files:</p>
  <pre><code>2020/11/19 04:31:57 ERROR 0 (0x00000000) r E:\Tableau\TableauFileFolder\TableauFile.twbx
  The operation completed successfully.
  </code></pre>
  <p>Admin user running the commands has full control permission on the Tableau folder of the share.</p>
  <p>I've been having this issue for a while and I can't find a solution anywhere. I'm not using /MIR so I don't know what could be causing the destination files to be deleted.</p>