0

I'm currently using a robocopy in a loop performing the following command over a number of different directories:

robocopy $sourceFolder $purgeFolder /MOV /LEV:0 /MINAGE:$OlderThan

All source folder paths are at the same level in our directory structure and have exactly the same permissions however when the loop reaches certain directories robocopy just continually reports ERROR 87 (0x00000057) Accessing Destination Directory. The script is being run with a service account with full control over the directories and files, and when I run the script myself I don't encounter the same issues. Robocopy itself creates the $purgeFolder successfully however then reports it can't access it.

Etterz
  • 1
  • 1
  • 1
  • Might be worth running Process Monitor to see what exactly is happening from the file system's point of view when robocopy fails. – Harry Johnston Nov 21 '19 at 07:33
  • After reading [https://serverfault.com/questions/892031/robocopy-error-50-accessing-destination-directory-request-is-not-supported?answertab=active#tab-top](https://serverfault.com/questions/892031/robocopy-error-50-accessing-destination-directory-request-is-not-supported?answertab=active#tab-top) Adding /COPY:DT /DCOPY:T fixed the issue. – Etterz Nov 25 '19 at 04:17

0 Answers0