Getting ERROR 5 (0x00000005) Creating Destination Directory while using robocopy to copy files

3

I am getting the above error while I am using robocopy command. I have given all possible permissions on both source and destination folders but still I am getting this error. Any idea how to fix this.

windows
teamcity
webdeploy
robocopy
asked on Stack Overflow Jul 18, 2011 by sam

2 Answers

1

Is this to and from ntfs partitions?

If you are coping to FAT of EXT then add the /FFT parameter to assume FAT file times (2 second granularity) ext2/ext3 also uses 2 second granularity.

You could also try using the /COPY:DT parameter, by default robocopy copies the data, attributes and timestamp /COPY:DT will skip the attributes.

Also check your share permissions as well as your ntfs permissions

answered on Stack Overflow Jul 18, 2011 by Phil Eddies
0

For me it worked fine when I ran the command directly on the server, but when I ran it from PowerShell remoting I would get this error. I was also trying to copy files from the local machine to a network share. The fix for me was to use:

Invoke-Command -ComputerName $sourceServer -Credential $credential -Authentication Credssp -ScriptBlock {
    & RoboCopy "C:\Source" "\\OtherServer\C$\Destination" /E
}

Specifically, using -Credential $credential -Authentication Credssp fixed the issue for me.

You didn't provide enough info to know if this is the same issue you were having, but thought I'd mention it for others who encounter the same error message.

answered on Stack Overflow Jan 4, 2021 by deadlydog

User contributions licensed under CC BY-SA 3.0