sam
sam

Reputation: 4684

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

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.

Upvotes: 3

Views: 14911

Answers (3)

David Vaught
David Vaught

Reputation: 1

It may be a simple answer... check the space left on the Target drive.

Upvotes: 0

deadlydog
deadlydog

Reputation: 24424

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.

Upvotes: 0

Phil Eddies
Phil Eddies

Reputation: 208

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

Upvotes: 2

Related Questions