HT201625: Manage and back up your iTunes media library

Learn about Manage and back up your iTunes media library
purvis

Q: Copying files failed.  The file name was invalid or too long


trying to set up iTunes transfer from old desktop to laptop.  Consolidated files but stopped with the above iTunes error msg.  Unsure on how to correct or change.  Thanks for all help!

dell, Windows XP

Posted on Mar 17, 2015 8:06 AM

Close

Q: Copying files failed.  The file name was invalid or too long

  • All replies
  • Helpful answers

  • by hhgttg27,

    hhgttg27 hhgttg27 Mar 17, 2015 5:55 PM in response to purvis
    Level 5 (5,407 points)
    iTunes
    Mar 17, 2015 5:55 PM in response to purvis

    The most likely cause for this is that your iTunes media folder is not in the standard location - on XP this will be C:\Documents and Settings\username\My Documents\My Music\iTunes\iTunes Media - and/or you don't have the first of these options checked in Edit > Preferences > Advanced:

    Advanced Preferences checkboxes.jpg

    There are two limiting factors that apply here:

     

    • the maximum path length in Windows is 255 characters
    • when configured to organize files and folders within your library, iTunes will automatically truncate any files/folder names to 40 characters

     

    With the default media folder location the longest possible path for music files is 156 characters + the length of your Windows username - will within Windows' limits.  If, however:

     

    • you've configured iTunes to not keep the iTunes Media folder organized, and
    • your media folder is in a different location with a longer path name, and/or
    • the music that you're consolidating into it has some file or folder names that exceed 40 characters

     

    then the fully qualified path that iTunes determines during consolidation may exceed the Windows 255-character limit.  In most cases I suspect that checking the Keep iTunes Media folder organized option should be sufficient to avoid this error, unless your media folder is nested very deep in the Windows directory structure.