File Name or Extension is too long

Microsoft Windows xp professional w/serv...
March 8, 2010 at 20:26:19
Specs: Windows XP
I am trying to copy one folder from one place
to other place of different server. It shows the
error "File name or extension is too long , can't
Is there any DOS base command or third party
software that i can use to copy the folder.
please tell the full command in dos or any s/w.
thanks for assistance.

See More: File Name or Extension is too long

Report •

March 9, 2010 at 07:03:00

xcopy c:\yourpath\ c:\destinationpath\ /s /e

but it will not work if your directory tree is to long which causes the error you had above. Can you expand the path out to show all sub-directories. I am betting you have too many sub-directories in the directory you are trying to copy.

Report •

March 9, 2010 at 20:28:46

Thanks for reply. xcopy i working and i experienced.
In my case there are lot of directories inside. I've tried also by
using SUBST command via DOS but can't execute command
i think so syntex error. Below link is fyi

Have you experienced the SUBST command.
waiting for further.

Report •

March 10, 2010 at 03:01:03
That is indeed pretty annoying ... one solution is to try and flatten the structure some way or another. For example, if you ever see a directory that contains no files and only ONE directory, you are looking at a useless directory.

The error lies in the File System, which allows structures deeper than some other systems do. In fact, they allow a too deep structure. I had these kind of problems mostly when copying to CDFS (the CD/DVD file structure, probably ISO whatever) which also allows less deep structures than NTFS does. It's a PITA

Report •

Related Solutions

March 10, 2010 at 03:48:56
there are deep folders, i can't go inside each folder can't guess
the depth and can't find manually long file names.
But where is solution.
How to execute SUBST command, i believe it'll work.
Any more assistance ?

Report •

March 10, 2010 at 06:59:59
Unfortunately you are going to have to I have run into this very same problem a couple of times my self and is why I know that your problem has to do with directory length. I made some backup scripts which where making directories with in directories instead of over writing them. I had to drill down as far as Windows would let me and start deleting them one by one until I deleted enough to get rid if the file name too long error. The bad thing is you can't just delete them because you will get the same error. You have to cut and paste the last directory it will allow you access to and paste it in the root folder; then you can delete it if it does not have too many directories in it. If it does then you do the same step on the directories you just cut and pasted until it does allow you to delete it.

It sucks I know.

Report •

March 10, 2010 at 21:42:38
thnx buddy for the details once again.

i'll practice that one again.
it'll take really massive time to find out the folders/files in depth.

have a nice day

Report •

March 11, 2010 at 20:36:32
khuram, maybe I'm all wet (?), but it seems to me that the copy command will do all that for you IF you copy the file to it's own drive (called something profound like 'test') FIRST and then copy the copy to the foreign drive?
Seems to me that any path data needed would be duplicated as needed when making the first copy and that copy should have a simple, straightforward path.
Ed in Texas.

Report •

Ask Question