Get Your Free IT Resume Guide

Robocopy: No, It’s Not a Giant Robot!

Topics Mentioned
Operating System(s):

Robocopy is a nifty little tool that’s been around for a while under the Windows Resource Kit, but Uncle Bill and the gang over at Microsoft have decided that its time has come. Robocopy makes its desktop debut in Vista!

So many of us admins love to pick up another scripting option, and Robocopy is a welcome addition to our Vista toolbox. Okay, sure, it copies stuff, but how it copies stuff is a different story. It only copies whole folders, not individual files. Think of it more like a “smart” copy utility. It has over 80 different switches that automate copying tasks.

Let’s take a look at some of the more popular ones:

Example # 1: /MIR and /Z

  • robocopy \\BigServer\ThingFolder \\SmallServer\StuffFolder /MIR /Z

This command copies the contents of ThingFolder on BigServer to StuffFolder on SmallServer. The /MIR deletes any other file in StuffFolder that doesn’t have a corresponding match in ThingFolder. The /Z option will copy the files in restartable mode, which will resume the copy operation if the network freaks out and kills the copy operation for some weird reason.

Simple stuff, eh? Wrap that sucker into a batch script and you’ve got a simple backup strategy for an important folder.

Example # 2: /COPYALL

  • robocopy \\BigServer\ThingFolder \\SmallServer\StuffFolder /S /COPYALL

Once again, everything in ThingFolder is going to StuffFolder, but this time, the /S switch copies subdirectories unless they’re empty. The /COPYALL switch grabs the original NTFS permissions as well, so you don’t have to wrestle inheritance if there’s a conflict.

Other command line switches include:

  • /S – which copies subdirectories, but only if they’re not empty
  • /E – which copies subdirectories, even if they’re empty
  • /MOV – used to move files, removing them from the source folder

Robocopy is Your Smart and Helpful Friend

Robocopy is also extremely reliable, flexible, and very robust. For example, in case of a network outage, copying is resumed where it was previously cut off without any problems. So if you find yourself halfway through a 4GB file and your network goes down all is not lost! Robocopy is smart enough to wait until the network connection is restored to copy the rest of the file. How cool is that?

Here are some more examples of what Robocopy can do:

  • Copy large numbers of files
  • Copy entire subdirectories
  • Copy attributes, owner information, alternate data streams, auditing information, and more all by default
  • Copy NTFS access control list

With 80 different nifty neat-o switches, Robocopy is sure to become one of your favorite robotic assistants! Learn more about Robocopy and other nifty tools and features in our Windows Vista Training.

More Related Posts

  1. Vista Ready or Not …
  2. Windows Vista Features that I Like, Part 3 – System Restore
  3. 5 Cisco IOS Commands Every Network Admin Should Know
  4. Flaws Are Detected in Microsoft’s Vista
  5. 9 Ways Vista MMC Gives You More Control

Discussion

2 comments and trackbacks for “Robocopy: No, It’s Not a Giant Robot!

Comments

  1. Posted by Chris on October 12, 2007, 7:24 am

    Hi Ben,

    Was a bit surprised you didn’t mention Spotlight http://www.microsoft.com/technet/technetmag/issues/2006/11/UtilitySpotlight/ in your piece about Robocopy. But then I do suppose the piece was about Vista. Haven’t seen Robocopy in Vista yet (ain’t seen much of Vista to be honest) but I do hope it has the GUI as well as the command line options. The GUI makes for fast copy setups if you are not familiar with command line. Look forward to another excellent Train Signal masterpiece when I finally get the Vista CBT.

    Regards,

    Chris

  2. Posted by Abdul Rafeeque on March 11, 2008, 8:01 am

    Hi Ben,

    It is very useful information, wish you all the best

    Regards,
    Abdul Rafeeque

Post a comment

XHTML: You can use these tags: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>