Robocopy , the robust file copying tool from Microsoft, is certainly one of the most frequently used backup programs. We have reported on the possibilities of Robocopy and its parameters several times in the past , you will find a complete list of information at the end of this article.
Today we want to tell you about Robocopy Error 5 (0x00000005) , which can occur under certain circumstances. We also found this error code 0x00000005 in a robocopy script and show you how you can fix this error.
Here is a copy of the error message in advance.
The exact error message is:
Error 5 (0x00000005) NTFS security is copied to the target directory – access is denied
Strangely enough, this error code occurred all at once without making any changes to the Robocopy command or the data. It was initially unclear why this access error 5 occurred while copying the files.
After some research on the Internet, it became clear that it was due to the security rights of the Robocopy command. We have with the parameter
give Robocopy the instruction that all file information of the original files should also be copied. Here is an extract from Robocopy Help.
COPYALL = Copies all file information (corresponds to “/ COPY: DATSOU”)
If copy error 5 (0x00000005) occurs, Robocopy cannot set the security rights correctly on the target system. Be remedied only the correction of Robocopy parameter COPYALL on
which then copies the file attributes ” D = data ” and ” T = time stamp “. As soon as we had adjusted the parameter accordingly, error code 5 (0x00000005) no longer occurred.
Finally you will find further articles and information about the Robocopy command here .
– Robocopy error code 0x00000040 when copying files and folders with umlauts
– Robocopy tasks run slower than normal via task scheduler (Task Scheduler)
– Robocopy errors 1392 (0x00000570) – The file or directory is damaged and cannot be read.
– Accelerate Robocopy with parameter / MT
– Robocopy – Prevent existing files from being copied again – Parameter / FFT
– Copy directories without authorization with Robocopy
– Robocopy error while copying 0x80070021