0 - Files were copied without error.
1 - No files were found to copy.
2 - The user pressed CTRL+C to terminate xcopy. enough memory or disk space, or you entered an invalid drive name or invalid syntax on the command line.
5 - Disk write error occurred.
Robocopy返回代码:
0 - No errors occurred, and no copying was done. The source and destination directory trees are completely synchronized.
1 - One or more files were copied successfully (that is, new files have arrived).
2 - Some Extra files or directories were detected. No files were copied Examine the output log for details.
3 - (2+1) Some files were copied. Additional files were present. No failure was encountered.
4 - Some Mismatched files or directories were detected. Examine the output log. Some housekeeping may be needed.
5 - (4+1) Some files were copied. Some files were mismatched. No failure was encountered.
6 - (4+2) Additional files and mismatched files exist. No files were copied and no failures were encountered. This means that the files already exist in the destination directory
7 - (4+1+2) Files were copied, a file mismatch was present, and additional files were present.
8 - Some files or directories could not be copied (copy errors occurred and the retry limit was exceeded). Check these errors further.
16 - Serious error. Robocopy did not copy any files. Either a usage error or an error due to insufficient access privileges on the source or destination directories.
6条答案
按热度按时间nafvub8i1#
Robocopy在新版本的windows中取代了XCopy
1.使用镜像,XCopy不使用
1.有一个/RH选项,允许在设定的时间内运行拷贝
1.有一个/MON:n选项来检查文件中的差异
1.复制的文件属性多于XCopy
是的,我同意马克·塞切尔的观点,他们都是垃圾。
更新:
XCopy返回代码:
Robocopy返回代码:
这里有更多关于Robocopy返回值的详细信息:http://ss64.com/nt/robocopy-exit.html和XCopy:https://ss64.com/nt/xcopy.html
qoefvg9y2#
最重要的区别是
robocopy
在错误发生时会(通常)重试,而xcopy
不会。在大多数情况下,这使得robocopy
更适合在脚本中使用。dgiusagp3#
我能看到的不同之处是Robocopy有更多的选项,但我没有发现任何一个特别有用,除非我在做一些特别的事情。
我对几个复制例程做了一些基准测试,发现XCOPY和ROBOCOPY是最快的,但令我惊讶的是,XCOPY一直超过Robocopy。
具有讽刺意味的是,robocopy会重试失败的副本,但在我的基准测试中,它也失败了很多次,而xcopy从未失败过。
在基准测试之后,我做了完整的文件(逐字节)比较。
以下是我在测试中使用robocopy的开关:
如果有人知道一个更快的组合(除了删除/E,我需要),我很乐意听到。
robocopy的另一个有趣/令人失望的事情是,如果复制失败,默认情况下它会重试1,000,000次,每次重试之间有30秒的延迟。如果你正在无人值守地运行一个长批处理文件,当你在几个小时后回来发现它仍然试图复制某个特定文件时,你可能会非常失望。
使用/R和/W开关可以更改此行为。
如果有办法在这里附加文件,我可以分享我的结果。
我还在测试中包括了FastCopy和Windows Copy,每个测试运行10次。注意,差异非常显著。95%置信区间没有重叠。
pxq42qpu4#
听到人们仍然在 *{COPY}的手中受苦是很痛苦的,不管是什么版本。我是一个经验丰富的Bash脚本作家,我推荐rsync,你可以在cygwin中运行它(cygwin.org)或者你可以找到一些浮动的二进制文件。你可以将输出重定向到2〉&1到一些日志文件,如out.log,以供以后分析。祝大家好运,是时候再次热爱生活了。=M.Kaan=
k3bvogb15#
我写了很多脚本来自动化日常备份等。以前我使用XCopy,然后转移到Robocopy。无论如何,Robocopy和XCopy都经常用于Windows中的文件传输。Robocopy代表健壮的文件复制。所有类型的巨大文件复制都使用这两个命令,但Robocopy增加了选项,使复制更容易以及用于调试目的。
话虽如此,让我们谈谈这两者之间的特点。
希望这对你有帮助。
13z8s7eq6#
它们都是垃圾!
XCOPY
更老,不可靠,所以微软用ROBOCOPY
取代了它,它仍然是垃圾。http://answers.microsoft.com/en-us/windows/forum/windows_8-files/robocopy-appears-to-be-broken-in-windows-8/9a7634c4-3a9d-4f2d-97ae-093002a638a9
不过别担心,这是一个由来已久的传统,由最初的
COPY
命令开始,直到今天,仍然需要/B
开关才能使其真正正确复制!