I'm kind of new to batch scripting. As a newbie I find both both of them useful while scripting What are the key differences between xcopy and robocopy?
XCOPY was older and unreliable, so Microsoft replaced it with ROBOCOPY , which is still rubbish.
The best alternative is TeraCopy, which is free. Other great apps like XCOPY are rsync, Ultracopier, Robocopy and SuperCopier. XCOPY alternatives are mainly File Copy Utilities but may also be File Sync Tools or File Managers.
xcopy is an external program, while copy is part of the interpreter (cmd.exe, command.com). This means that xcopy might not be present on another machine or a rescue disk. Since we have Windows and rescue CDs, that isn't really an issue anymore. copy can concatenate files.
Robocopy replaces XCopy in the newer versions of windows
Yes i agree with Mark Setchell, They are both crap. (brought to you by Microsoft)
UPDATE:
XCopy return codes:
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 returns codes:
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.
There is more details on Robocopy return values here: http://ss64.com/nt/robocopy-exit.html
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With