PDA

View Full Version : Error: "Windows cannot copy file. The filename or extension is too long


CostelloK
11th October 2008, 07:45 AM
We are moving from an HP NAS device running Windows Server 2003 (device specific version) to a new server running Windows 2003. When copying the files we get a message that a file name is too long. This then aborts the whole copy, leaving us unsure as to how far it has got.

This is a windows to windows copy so we can't see how the users could create file names that are too long - although we realise that it is treating the whole path as the 'file name'

Does any one have suggestions for a straightforward workaround or solution?
Is there a way to find the files with names above the limit.
What is the limit?

Also, any ideas on the max file length and how the users managed to create 'illegal' file names?

Thanks for you help as always

laurentio
11th October 2008, 07:49 AM
The users are probably accessing the folders through a share that's deeper down in the folder tree than when you copy from the root.
In addition, it's not technically illegal to have file paths longer than 255 characters; NTFS can easily handle this (the real limit are the 32.000 characters mentioned above). It's a matter of the API which the application accessing the files uses (and, yes, even Office 2003 can't handle file paths longer than the 255 characters, and Explorer has some problems, too, as you just noticed).

Use robocopy from the W2k3 resource Kit Tools; it can handle file paths up to 32.000 characters. It's the best tool for file server migrations anyway. Check robocopy.doc in the installation folder for details.
Windows Server 2003 Resource Kit Tools

Download here (http://www.microsoft.com/downloads/details.aspx?FamilyID=9D467A69-57FF-4AE7-96EE-B18C4790CFFD&displaylang=en)