Insufficient Memory – XCOPY

IT Support Forum Forums Development General Discussion Insufficient Memory – XCOPY

Viewing 1 reply thread
  • Author
    Posts
    • #2460
      Webmaster
      Keymaster

      When copying files with XCOPY, it fails to copy the files and I get the following error:

      Insufficient memory

      First of all it’s worth noting that this error does not mean that your computer has insufficient memory to run xcopy.

      If you get the insufficient memory error, this is because you have asked XCOPY to copy a file or folder whose file path has more than 255 characters in it. The 255 character file path limit is a limitation of XCOPY and the only solution is to change your file / folder structure or use another file copying program which doesn’t have the 255 character limit, such as Robocopy.

      I guess the 255 character limit in XCOPY is a secret, because wouldn’t it have been easier if the error just said that instead of a vague Insufficient memory message?

    • #2461
      Webmaster
      Keymaster

      An Explanation Of The 255 Character Limit

      I thought I might do a follow up post explaining XCOPY’s 255 character limit that results in the Insufficient memory error. The following file path has 24 characters:

      C:\Folder\Files\File.txt

      This is because “C:\” has 3 characters:

      C : \
      1 2 3

      “Folder\” has 7 characters:

      F o l d e r \
      1 2 3 4 5 6 7

      etc…

      An example of a directory that’s over 255 characters that would trigger XCOPY to report that there’s insufficent memory is:

      C:\Temp\SharedFolders\Sub_Folders\MyFilesAndFolders\FoldersBeginningWithR\RecentFoldersAndFiles\Folder1\Images\Photos\SharedPhotos\PersonalPhotos\Memories_PicturesToKeep_NotTemporary\BackupFiles\PhotosToKeep\PhotosOfMyDog\Rover\2022\February\Tuesday\Rover.jpg

      The above file path has 259 characters and therefore cannot be copied with XCOPY and will return an Insufficient memory error.

Viewing 1 reply thread
  • You must be logged in to reply to this topic.