XCOPY vs ROBOCOPY: Which do you like? If you’re a command line jockey, both Windows tools have their place. Here’s how I decide when to use which one.
Note: If you’re looking for a comparison of Robocopy and the third-party freemium tool Xxcopy, see this post.
In the beginning there was COPY, a DOS command to copy files one file at a time. It was fine for simple tasks, but once people had hard drives full of files, it started to show its limits since it was designed to run on original IBM PC computers with small amounts of memory. Microsoft’s solution was XCOPY, which extended COPY’s capabilities. Get it?
Today, the most important thing XCOPY added was the ability to copy subdirectories.
Once we got into corporate environments with networks full of servers, XCOPY started to show its limits. Along came ROBOCOPY, which added infinity minus one features. To me, the most important things it added were the ability to skip files that were already in place and to pick up and resume an interrupted copy where it left off. That way if the network connection dropped in the middle of copying half a gig of data, you didn’t have to start over. It also does hundreds of other things you might want to do, and hundreds of other things you never knew anyone would ever need to do.
That’s why ROBOCOPY is controversial. It’s one of the most powerful pieces of software Microsoft ever wrote. But I can think of maybe half a dozen pieces of software Microsoft wrote that people hate more. Microsoft Bob. Windows ME. Vista. Windows 8. Windows 8.1. And perhaps Microsoft Project. Those things you never knew anyone would ever need or want to do can bite you if you accidentally choose to do one of them.
XCOPY vs ROBOCOPY: XCOPY’s advantages
XCOPY’s biggest advantage is simplicity. You can type xcopy /s source destination, hit enter, and you know what it’s going to do. Plus, you can add some switches to prompt you or not prompt you, and there are some other switches that let you fine tune things, but it’s pretty straightforward. You can get by knowing a couple of switches, and as long as you type the filenames right, there won’t be any surprises.
I won’t create a section where I write about the disadvantages, because XCOPY’s strength is also its weakness. When it does what you need it to do, it’s a strength. When you run up against its limits, it’s no longer a strength. It’s a bit like my old Honda Civic. It was a fantastic commuter car but it was lousy for hauling lumber.
When simple tasks call for simple tools, use XCOPY. It saves the potential for mistakes.
XCOPY vs ROBOCOPY: ROBOCOPY’s disadvantages
I have no idea why Microsoft changed the syntax. It’s robocopy source destination files. Well, I kind of understand. Perhaps it’s more powerful this way. But it’s a lot more confusing. It’s almost as bad as the infamous PIP command.
It’s very easy to delete files you don’t mean to delete, and to copy a bunch of stuff where you don’t intend to.
If XCOPY is a hand saw, ROBOCOPY is a power saw with no safety features on it. If you’re a little bit afraid of it, that’s good. It means your brain works.
That said, you can put safety features on it. The problem is you have to put the safety features on yourself.
XCOPY vs ROBOCOPY: ROBOCOPY’s advantages
For one thing, on modern Windows systems, it’s just there. There’s a third party tool called XXCOPY that does what ROBOCOPY does but is more XCOPY like. But it’s a third party tool, and it’s not free for commercial use.
The other nice thing is that ROBOCOPY can sync up files and resume if it’s interrupted. When I had to copy huge files across a WAN link to Japan from St. Louis, ROBOCOPY was a lifesaver. The connection was guaranteed to drop several times during the copy. ROBOCOPY recovers gracefully from this situation. It just pauses momentarily, then tries again where it left off. That meant I could set up a copy on a Friday, and usually it would be done by lunchtime on Monday if the WAN link was especially bad, or by the time I got into the office on Monday. Doing the same thing with XCOPY never worked successfully.
Knowing how to successfully copy huge files across the WAN link successfully set me apart as a system administrator.
And when I was migrating file servers, nothing beat ROBOCOPY. I could copy everything with ROBOCOPY in advance, and then, when it was time to cut over, ROBOCOPY it again to quickly update just the new and changed files. During a maintenance window, there’s no comparing XCOPY vs ROBOCOPY. In theory DFS makes this kind of work unnecessary, but in practice, it seems like an awful lot of people still keep old-school fileservers around.
Some of the problems that ROBOCOPY solved for me in 2006 don’t exist anymore. But most of them do.
XCOPY vs ROBOCOPY — which do I use?
It depends. If I’m only copying one directory tree, and it’s not terribly large, I use XCOPY. It’s easier. But if I’m copying half a gig of data or more, I’ll probably use ROBOCOPY instead. I’d rather let ROBOCOPY get it right than babysit XCOPY. When you have a lot of data and a noisy network, there’s no comparing XCOPY vs ROBOCOPY. You need ROBOCOPY for that.