Xcopy error "insufficient memory" - found a work around with XXCOPY

Dude's picture
Windows Network Admin (Advanced) | Office / Business | Support | Windows 2003 Server Support

So I have a few users setup with daily backups using a bat file as referenced in
http://www.ctunion.com/node/35

So I noticed not all the user’s data was being copied, only half the data was being copied. So I ran the command from the bat file in a dos prompt:

xcopy "c:\Documents and Settings\user\My Documents" "d:\backup" /e /c /y /d

and it is setup to copy only files that have been modified with /d switch
I noticed after it copied some files that have changed it gave an "insufficient memory" error

I ran the same command again and it copied no files and returned the "insufficient memory" error again.

So after some Google searching I found there is a limitation of 254 characters in the fully qualified file name which is the driver letter, full directory path and file name. The My Documents folder in my case had multiple folders inside of folders inside of folders. After reaching a fully qualified name over 254 the xcopy stopped and reports the error.

I also found that there is a great program very similar to xcopy called XXCOPY which does NOT have the character limitation but uses the same switches and formatting.

So all I have to do was download and install XXCOPY from the site. I ran the same command as before except this time using xxcopy and BAM it worked like a champ. No more insufficient memory error and all the users’ files copied

http://www.xxcopy.com/index.htm

I added an extra X to all my lines in the batch files. I actually used the replace feature in notepad and replaced the word “xcopy” with “xxcopy”. This was such a time saver!!!

spankdaddy's picture

Better switch for XXCOPY = "/CLONE"

The /CLONE switch looks deceptively simple. But,
it is actually a combination of eight distinct
switches. Much of XXCOPY's flexibility comes from
combining a variety of switches. This particular
case is equivalent to the following command.

XXCOPY C:\ D:\ /ks/h/e/r/q/y/bi/zy/ze

Explanation:

/ks ; keeps source files' attributes exactly
/h ; copies hidden and system files
/e ; copies subdirectories (including empty ones)
/r ; overwrites read-only files if such files exist
/q ; suppresses display of skipped file in backup
/y ; overwrites existing files without prompt
/bi ; backs up incrementally (skips identical files)
/zy ; deletes extra files in destination if present
/ze ; disables XXCOPY's use of Envrionment variables