简体   繁体   English

使用 robocopy 复制文件时出现错误 5 (0x00000005) 创建目标目录

[英]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.我在使用 robocopy 命令时收到上述错误。 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.任何想法如何解决这个问题。

Is this to and from ntfs partitions?这是往返 ntfs 分区吗?

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.如果您要处理 EXT 的 FAT,则添加 /FFT 参数以假设 FAT 文件时间(2 秒粒度) ext2/ext3 也使用 2 秒粒度。

You could also try using the /COPY:DT parameter, by default robocopy copies the data, attributes and timestamp /COPY:DT will skip the attributes.您也可以尝试使用 /COPY:DT 参数,默认情况下 robocopy 复制数据、属性和时间戳 /COPY:DT 将跳过属性。

Also check your share permissions as well as your ntfs permissions还要检查您的共享权限以及您的 ntfs 权限

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.对我来说,当我直接在服务器上运行命令时它工作得很好,但是当我从 PowerShell 远程运行它时,我会收到这个错误。 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.具体来说,使用-Credential $credential -Authentication Credssp为我解决了这个问题。

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.您没有提供足够的信息来了解这是否与您遇到的问题相同,但我认为我会为遇到相同错误消息的其他人提及它。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM