Max length for file and folder names
Max length for file and folder names
Author
Discussion

TUS 373

Original Poster:

5,198 posts

311 months

Wednesday 14th December 2005
quotequote all
I am doing some spring cleaning of alot of files I have prepared for clients and trying to name and store them logically. However, some of the names for files are quite long. Although I seem to be able to use long names on them, Windows XP Pro occasionally reports that these names are too long when I am trying to click/drag, paste, cut copy etc from one location to another.

What is the max length of file and is there an easy way of telling when I have reached it, rather than when I attempt to move it. I would have thought that in this day and age PCs would be able to handle long names with some ease!

Thanks, Bryan

BliarOut

72,863 posts

269 months

Wednesday 14th December 2005
quotequote all
Stick to less than 255 characters. XP can theoretically handle longer, but it's bad practice to go beyond this.

pdV6

16,442 posts

291 months

Wednesday 14th December 2005
quotequote all
TUS 373 said:
Windows XP Pro occasionally reports that these names are too long when I am trying to click/drag, paste, cut copy etc from one location to another.

Are both locations on the same drive / partition? If not, are they formatted differently?

FourWheelDrift

92,337 posts

314 months

Wednesday 14th December 2005
quotequote all
Is it the Joilet ISO whatever standard being flagged up? Often happens when copying from HDD to CD.

TeamD

5,060 posts

262 months

Wednesday 14th December 2005
quotequote all
Why would you want to have a filename longer than (or anywhere near for that matter) 256 characters? Good grief, I only ever created a print queue approaching that length to annoy a tw@t who was upsetting our helpdesk.

TUS 373

Original Poster:

5,198 posts

311 months

Wednesday 14th December 2005
quotequote all
The files I am moving are from just one folder to another, sometimes generating new subfolders. These are all on the C drive i.e. no CD ROMs involved - all on the same HDD and partition.I reckon that some of these file names are less than 100 characters long, but of course the file path can be very long indeed when folders are nested within one another.

jamieboy

5,929 posts

259 months

Wednesday 14th December 2005
quotequote all
TUS 373 said:
the file path can be very long indeed

Not sure how practical this is for you, but you could create shares half-way down your folder structure (e.g. share "d:\my business stuff\financial stuff\invoices for 2005" as "invoices", and then copy to the share.

You'd have to refer to the share from them on to get at your documents, though, so may not be the right solution for you.

GreenV8S

31,024 posts

314 months

Wednesday 14th December 2005
quotequote all
I think there are separate limits for the length of the file name (256 chars I think) and the length of the full path to the file (1024 chars I think). I guess both of these limits may vary on different flavours of Windas. I don't know any way to find out of the path is valid other than to try to open it.

TUS 373

Original Poster:

5,198 posts

311 months

Wednesday 14th December 2005
quotequote all
Weird this.

The particular file I was trying to move consistently refused to be moved into another folder. I kept getting the "too long or invalid file name" error. This is tosh as it is about 100 characters long and accepted elsewhere!

I used "Send to" ro send it to the top of "My Documents" and then dragged it down from folder to folder until I got to the destination folder, where once again it refused to be moved. Solution: I created a new folder and dragged it into there. Moved the other files I wanted into there, deleted the original (now empty) folder and then renamed this one. It was a long workaround but worked.

What I don't understand is why this file refused to behave the same as others do. very strange, and this is on a very clean and recent install of XP Pro???

GreenV8S

31,024 posts

314 months

Wednesday 14th December 2005
quotequote all
Since migrating to XP Pro I've had a few problems with Windows Explorer / Internet Explorer / the entire sodding operating system (they seem to be more or less the same thing these days) where it consistently crashes when I access certain specific directories. (Taking the whole desktop down with it of course. Usually it comes back, but not always.) So far I haven't been able to find what it is about the directories which triggers it, but path length may be a factor. It definitely seems to be associated with the names rather than the contents. Perhaps you're running into something similar.

zumbruk

7,848 posts

290 months

Wednesday 14th December 2005
quotequote all
And this suprises you why?

GreenV8S

31,024 posts

314 months

Wednesday 14th December 2005
quotequote all
zumbruk said:
And this suprises you why?


Old fashioned windows explorer seemed to be pretty stable, until they started putting all this new-fangled rubbish in it.

Plotloss

67,280 posts

300 months

Wednesday 14th December 2005
quotequote all
Stick to 8.3 and be creative, its easier in the long run.

BliarOut

72,863 posts

269 months

Wednesday 14th December 2005
quotequote all
Just a hunch, scandisk it.