Search the NickWorks Blog

Monday 16 May 2016

XCOPY bug

I have used XCOPY as a command line tool to back up machines that won't boot. A Windows 10 machine will give you access to a command window where you can copy any files you need to keep to a USB drive.

But I have been getting "Out of memory" errors, which then cause the copy operation to crash. The message is misleading - all it means is that the copying has come across a source filename which is too long (more that 128 characters).

The simplest solution is just to use ROBOCOPY with a syntax like:

ROBOCOPY /E C:\users\user\Documents G:\backups\person\Documents

If you want to copy a single file, name it:

ROBOCOPY C:\Windows\System32\Config\ G:\backups\person\ SOFTWARE