A Nifty Tool: xxcopy

by tdaxp ~ March 16th, 2007

Lady of tdaxp is planning on replacing her notebook in the near future, so I (ever valiant) offered to backup everything on her laptop to my portable USB harddrive. I opened the dos prompt by entering “cmd” in the Start | Run dialog of Windows xcopy, typed the necessary command to xcopy and got an “insufficient memory error” when it got to copying over the file ntuser.dat Using Microsoft’s “wrapper” for xcopy

@echo off
rem COPYIT.BAT transfers all files in all subdirectories of
rem the source drive or directory (%1) to the destination rem drive or directory (%2)

xcopy %1 %2 /s /e

if errorlevel 4 goto lowmemory
if errorlevel 2 goto abort
if errorlevel 0 goto exit

:lowmemory
echo Insufficient memory to copy files or
echo invalid drive or command-line syntax.
goto exit

:abort
echo You pressed CTRL+C to end the copy operation.
goto exit

..merely confirmed that I had run into a fatal low memory error. DOS bat files, unlike other basic programming languages, does not have an “on error resume next” command, so I could never get more than a small fraction of the drive copied.

(I didn’t even try with the simple Copy-and-Paste feature of Windows, for the same reason that I don’t try jumping-out-of-the-windowas a convient way of moving from my fifth floor office to the ground below when I leave work.)

Fortunately, I found a free program called xxcopy which is in every way an improvement over the xcopy included in Microsoft Windows. XXCopy accepts the same command line arguments, but also includes some new ones which make things easier to remember. So now I can enter “xxcopy c: f:backup /copy”, and the drive is backed up.

And the ntuser.dat error? It turns out Microsoft lies (no surprise). Mere users don’t have permission to make back-ups of their ntuser.dat profile pages, but to hide this fact from the naive the command box makes it look like you need to go out and buy more memory. XXCopy isn’t able to force a copy, but it is able to go around the problem — giving up on files on your comptuer that you own but Microsoft won’t let you backup, and continuing to copy the rest.

So: xxcopy. Good software. Good price (free). Good deal.

Post to Twitter Tweet This Post

3 Responses to A Nifty Tool: xxcopy

  1. Dan tdaxp

    Typo fixed!

    There's an expression that screams poetry…

    (Now where was Sean there? I can't believe someone beat him to it!)

  2. aaron

    I'd gladly help transfer an identical copy using an Ubuntu Live CD or some other solution. Don't trust Windows to copy live files.

    (That's a freebie to Ry and others, now they know I'm additionally a god damn Linux hippy.)

  3. Curtis Gale Weeks

    God price?

  4. Jonathan

    I've been using xxcopy for years to back up hard drives. It is excellent.

  5. Dan tdaxp

    Aaron, I've had positive experiences with Ubuntu. (Now if only iTunes worked on it…)

    Jonathan, I agree. The choice for me came down to xxcopy and Microsoft robocopy. However, as Microsoft already caused this problem (Windows copy couldn't work, nor could “copy,” and xcopy was the thing causing problems) I decided to go with the non-redmond solution.

  6. Dan tdaxp

    Update: Because xxcopy is unable to copy filenames with Chinese characters, I had to dump it for robocopy. I'm very happy with that Microsoft utility, though I have to use the /W:2 /R:2 flags, otherwise it will take a million years (literally).

Leave a Reply

Twitter links powered by Tweet This v1.6.1, a WordPress plugin for Twitter.