gpt4 book ai didi

windows - xcopy 和 robocopy 的区别

转载 作者:可可西里 更新时间:2023-11-01 11:57:16 27 4
gpt4 key购买 nike

我是批处理脚本的新手。作为新手,我发现它们在编写脚本时都很有用xcopy 和 robocopy 之间的主要区别是什么?

最佳答案

Robocopy 在较新版本的 Windows 中取代了 XCopy

  1. 使用镜像,XCopy 不使用
  2. 有一个/RH 选项,允许设定的时间让副本运行
  3. 有一个/MON:n 选项来检查文件中的差异
  4. 比 XCopy 复制更多的文件属性

是的,我同意 Mark Setchell 的观点,他们都是废话。 (由 Microsoft 提供给您)


更新:

X复制返回码:

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.

这里有关于 Robocopy 返回值的更多详细信息:http://ss64.com/nt/robocopy-exit.html

关于windows - xcopy 和 robocopy 的区别,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/24121046/

27 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com