1. ホーム
  2. windows

[解決済み] xcopyとrobocopyの違いについて

2022-03-07 22:54:56

質問

私はバッチスクリプトの初心者なんです。 初心者の私は、スクリプト中に両方の両方が便利だと思います xcopyとrobocopyの主な違いは何ですか?

どのように解決するのですか?

Windowsの新しいバージョンでは、ロボコピーがXCopyを置き換えます。

  1. ミラーリングを使用、XCopyは使用しない
  2. コピー実行時間を設定する/RHオプションがあります。
  3. ファイルの差分をチェックするための/MON:nオプションがあります。
  4. XCopy よりも多くのファイル属性をコピーします。

マーク・セッチェルの意見に賛成です、どちらもくだらないものです。(マイクロソフトによってもたらされた)


UPDATEです。

XCopyのリターンコード。

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.

ロボコピーはコードを返します。

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.

ロボコピーの戻り値の詳細については、こちらをご覧ください。 http://ss64.com/nt/robocopy-exit.html