Windows XP file name length limit - Microsoft Windows

This is a discussion on Windows XP file name length limit - Microsoft Windows ; Does anyone know how in God's name you configure or tweak the limit on file name length in XP? I know it can be done, because I've found that the limit varies over time, and from one location in my ...

+ Reply to Thread
Page 1 of 2 1 2 LastLast
Results 1 to 20 of 25

Thread: Windows XP file name length limit

  1. Windows XP file name length limit

    Does anyone know how in God's name you configure or tweak the limit on
    file name length in XP?

    I know it can be done, because I've found that the limit varies over
    time, and from one location in my directory tree to another, seemingly
    autonomously and more-or-less at random. And obviously if it can vary,
    it can be deliberately made to vary.

    Where is it stored? Why *is* there apparently an individual length limit
    per folder, rather than a single global one? (I know it varies, because
    I can rename a file and have it succeed, then try to move it and get a
    complaint that the name is "too long or invalid" -- the file's name
    surely can't have spontaneously grown some disallowed characters from a
    mere click and drag without any hand touching the keyboard, so the
    destination folder must have a shorter length limit than the source
    folder for this to occur.)

    It must be somewhere -- a hidden file, a registry key. I've got gobs of
    disk space and RAM, so if raising the limit above the default in a lot
    of places chews some up I'm OK with that. I'd also like to turn off
    whatever space-optimizing is mucking with the limits and setting them
    arbitrarily to different values all over my system -- MS always tries to
    do something clever and ends up doing something really dumb, it seems,
    from quotation marks that won't render properly except in MS Office
    products and IE, to the infamous dancing paperclip, to these filesystem
    shenanigans...

    Odd thing is, there's nothing documented about the limit and how it is
    configured. Even the TweakUI power toy doesn't seem to have a setting
    for it, and the most obvious Google and regedit searches have turned up
    blank. The desktop.ini or folder.ini files perhaps?

    Regardless, it's a nuisance. It's apparently somewhere around 128
    characters, most of the time, and sometimes and in some directories
    maybe as little as 64. That's ludicrously short. When you need a
    descriptive name for a file you can't pack much into 64 characters.

    I tried one workaround already with astonishing but not very helpful
    results. I figured I could just delete and recreate a directory and
    move/copy files into it and back out until it came up with a generous
    length limit. So I made a sister directory "tmp" for one directory,
    moved everything into "tmp", and moved in the additional file that
    wouldn't go into the original directory. It went into "tmp" just fine,
    so I'd apparently gotten a better limit on the first shot. The fun began
    when I nuked the now-empty original directory and renamed "tmp". The
    file suddenly could not be opened, used, moved, renamed, deleted ... It
    was apparently there, but not accessible somehow. Renaming the directory
    back to "tmp" fixed it, thank goodness.

    I've since determined that Windows remembers deleted folders, and caches
    folder settings of some kind. For example, if I make a directory "foo",
    put images in it, and set it to Thumbnails, then make a directory "bar",
    leave it on Tiles, and move the images there, then nuke "foo" and rename
    "bar", "bar" (now "foo") changes to Thumbnails view. If I'd
    shift-clicked Thumbnails to get thumbnails with no text labels, the new
    "foo" inherits this also. If I'd forced a short directory to list view
    and did the same move files, remove old dir, rename tmp dir trick, it
    would now show list view despite the small number of files for which
    Tiles would be the default.

    It seems the name limit default is perhaps adequate, but the "ghost" of
    a deleted folder whose limit somehow got shortened will linger on and
    cause any new folder of the same parent that gets given the same name to
    inherit the ghost's shoddy limit. So a minimum is: I need to be able to
    delete "ghost folders". (As the system administrator, I bloody well
    should be able to, and directly twiddle the limit besides!)

    Does anyone here know much more about this? My experimentation has
    failed to reveal a viable workaround except for the case where it's
    acceptable for the path to the files to change, where I can make a new
    directory, move the files to it, and just leave the new directory with
    its new name, thereby avoiding the ghost of the old one. Renaming
    directories even to names that never existed also seems to sometimes
    change the limit, usually in the shrinking manner, so subsequently
    changing something like "tmp" to something meaningful is problematic
    too. Naming it something meaningful in the first place being an option
    of course.

    Ultimately, though, I don't want some dodgy workaround that sometimes
    works and often means gratuitously rearranging my file system; I want
    absolute and uncontested mastery over every bit and byte in this f*@!ing
    box. Given what it cost to buy and later upgrade, I think that is my
    right...

    --
    There's only four things you can be certain of: taxes, change, spam, and
    death.

  2. Re: Windows XP file name length limit

    Phil Cartwright wrote:
    > Does anyone know how in God's name you configure or tweak the limit on
    > file name length in XP?
    > Regardless, it's a nuisance. It's apparently somewhere around 128
    > characters, most of the time, and sometimes and in some directories
    > maybe as little as 64. That's ludicrously short. When you need a
    > descriptive name for a file you can't pack much into 64 characters.


    As far as I know it is 256 characters, 0-255. You seem to have a problem
    somewhere.



  3. Re: Windows XP file name length limit

    Phil Cartwright wrote:

    >I know it can be done, because I've found that the limit varies over
    >time, and from one location in my directory tree to another, seemingly
    >autonomously and more-or-less at random. And obviously if it can vary,
    >it can be deliberately made to vary.


    If you understood that, why have you ignored the tiny fact that the path
    is included in the total filename length? So each character in the path
    is cut off the 256 possible. So this limit does not only include
    filename.example, but c:\documents and
    settings\username\this\that\whatnot\somewhere\deep \down and so on.


    If your file has a name of, say, 100 characters, and the directory path
    where it is has 160 characters, you're past the 256 limit.




    JK'07

  4. Re: Windows XP file name length limit

    Jan Kannemacher wrote:
    > Phil Cartwright wrote:
    >
    >
    >>I know it can be done, because I've found that the limit varies over
    >>time, and from one location in my directory tree to another, seemingly
    >>autonomously and more-or-less at random. And obviously if it can vary,
    >>it can be deliberately made to vary.

    >
    >
    > If you understood that, why have you ignored the tiny fact that the path
    > is included in the total filename length? So each character in the path
    > is cut off the 256 possible. So this limit does not only include
    > filename.example, but c:\documents and
    > settings\username\this\that\whatnot\somewhere\deep \down and so on.
    >
    > If your file has a name of, say, 100 characters, and the directory path
    > where it is has 160 characters, you're past the 256 limit.


    Well that was bloody stupid of Microsoft! How is anyone supposed to pack
    any kind of descriptive information in there, then, even with
    subdirectories, or properly organize their files?

    Anyway you have failed to answer my question: Where is this limit
    adjusted? Obviously it's inadequate, and probably for lots of people,
    not just me. Where can it be configured for those who need more?
    Remember, I've got disk space to burn...

    --
    There's only four things you can be certain of: taxes, change, spam, and
    death.

  5. Re: Windows XP file name length limit

    On Tue, 19 Jun 2007 20:06:12 -0400, Phil Cartwright
    wrote:

    >Jan Kannemacher wrote:
    >> Phil Cartwright wrote:
    >>
    >>
    >>>I know it can be done, because I've found that the limit varies over
    >>>time, and from one location in my directory tree to another, seemingly
    >>>autonomously and more-or-less at random. And obviously if it can vary,
    >>>it can be deliberately made to vary.

    >>
    >>
    >> If you understood that, why have you ignored the tiny fact that the path
    >> is included in the total filename length? So each character in the path
    >> is cut off the 256 possible. So this limit does not only include
    >> filename.example, but c:\documents and
    >> settings\username\this\that\whatnot\somewhere\deep \down and so on.
    >>
    >> If your file has a name of, say, 100 characters, and the directory path
    >> where it is has 160 characters, you're past the 256 limit.

    >
    >Well that was bloody stupid of Microsoft! How is anyone supposed to pack
    >any kind of descriptive information in there, then, even with
    >subdirectories, or properly organize their files?


    Assuming we're talking about NTFS and not FAT32, the "255 characters
    for path+file" is a limitation of Explorer, not the filesystem itself.
    NTFS supports paths up to 32,000 Unicode characters long, with each
    component up to 255 characters.

    Explorer -and the Windows API- limits you to 260 characters for the
    path, which include drive letter, colon, separaing slashes and a
    terminating null character. It's possible to read a longer path in
    Windows if you start it with a \\

    See
    http://msdn.microsoft.com/library/de...ing_a_file.asp





  6. Re: Windows XP file name length limit

    Spalls Hurgenson wrote:
    > Explorer -and the Windows API- limits you to 260 characters for the
    > path, which include drive letter, colon, separaing slashes and a
    > terminating null character. It's possible to read a longer path in
    > Windows if you start it with a \\


    How do you lengthen this? If NTFS/the operating system supports more,
    and it's just broken user applications causing all the trouble, I want
    to be able to use more.

    --
    There's only four things you can be certain of: taxes, change, spam, and
    death.

  7. Re: Windows XP file name length limit

    Spalls Hurgenson wrote:

    >Explorer -and the Windows API- limits you to 260 characters for the
    >path, which include drive letter, colon, separaing slashes and a
    >terminating null character. It's possible to read a longer path in
    >Windows if you start it with a \\


    I remember only too well how certain people screwed up my backups in the
    office. Backup Exec can't save files if the path- and filename is too
    long, thus marking the entire backup as failed - and OF COURSE the next
    file somebody wants to be restored is one of them.

    Anyway. 256 or 260 is usually sufficient, after all the content is
    supposed to be in the FILE, not the NAME. Anybody who's running into
    trouble with this limitation shouldn't produce big comments about
    "broken applications" but give a thought to proper organisation of
    things. Millions of people all over the world never have any problems
    with this limit...




    JK'07

  8. Re: Windows XP file name length limit

    Jan Kannemacher wrote:
    > Anyway. 256 or 260 is usually sufficient, after all the content is
    > supposed to be in the FILE, not the NAME. Anybody who's running into
    > trouble with this limitation shouldn't produce big comments about
    > "broken applications" but give a thought to proper organisation of
    > things. Millions of people all over the world never have any problems
    > with this limit...


    And if there's a reason not to alter the file itself? (I can think of
    plenty. Copyright; the file is functional, e.g. an executable; the file
    is indexed somewhere by hash, so it cannot be altered without becoming
    unfindable by another method...)

    Besides, it's been admitted that the limit in the OS internals is 32000.
    That truly ought to be enough for anybody. Any stricter limit is the
    result of the application layer. Apparently Backup Exec is awful, awful
    software, much as we already knew Explorer and its close cousin Internet
    Exploder to be...

    But I suppose divergent, changing, arbitrary, random, and too-small
    limits are to be expected from Bill "640K" Gates, even now over a decade
    after he supposedly learned his lesson.

    --
    There's only four things you can be certain of: taxes, change, spam, and
    death.

  9. Re: Windows XP file name length limit

    Jan Kannemacher wrote:
    > Phil Cartwright wrote:
    >
    >> I know it can be done, because I've found that the limit varies over
    >> time, and from one location in my directory tree to another,
    >> seemingly autonomously and more-or-less at random. And obviously if
    >> it can vary, it can be deliberately made to vary.

    >
    > If you understood that, why have you ignored the tiny fact that the
    > path is included in the total filename length? So each character in
    > the path is cut off the 256 possible. So this limit does not only
    > include filename.example, but c:\documents and
    > settings\username\this\that\whatnot\somewhere\deep \down and so on.
    >
    >
    > If your file has a name of, say, 100 characters, and the directory
    > path where it is has 160 characters, you're past the 256 limit.


    Thanks for that reminder Jan, that is exactly the situation of course, I
    forgot the stuff about the path. My folder paths are rarely more than
    two or three deep.



  10. Re: Windows XP file name length limit

    Phil Cartwright wrote:
    > Jan Kannemacher wrote:
    >
    >> Anyway. 256 or 260 is usually sufficient, after all the content is
    >> supposed to be in the FILE, not the NAME. Anybody who's running into
    >> trouble with this limitation shouldn't produce big comments about
    >> "broken applications" but give a thought to proper organisation of
    >> things. Millions of people all over the world never have any problems
    >> with this limit...

    >
    >
    > And if there's a reason not to alter the file itself? (I can think of
    > plenty. Copyright; the file is functional, e.g. an executable; the file
    > is indexed somewhere by hash, so it cannot be altered without becoming
    > unfindable by another method...)
    >
    > Besides, it's been admitted that the limit in the OS internals is 32000.
    > That truly ought to be enough for anybody. Any stricter limit is the
    > result of the application layer. Apparently Backup Exec is awful, awful
    > software, much as we already knew Explorer and its close cousin Internet
    > Exploder to be...
    >
    > But I suppose divergent, changing, arbitrary, random, and too-small
    > limits are to be expected from Bill "640K" Gates, even now over a decade
    > after he supposedly learned his lesson.


    Well?

    I still don't see anyone suggesting a fix. Why is that?

    --
    There's only four things you can be certain of: taxes, change, spam, and
    death.

  11. Re: Windows XP file name length limit

    Phil Cartwright wrote:
    > Phil Cartwright wrote:
    >> Jan Kannemacher wrote:
    >>
    >>> Anyway. 256 or 260 is usually sufficient, after all the content is
    >>> supposed to be in the FILE, not the NAME. Anybody who's running into
    >>> trouble with this limitation shouldn't produce big comments about
    >>> "broken applications" but give a thought to proper organisation of
    >>> things. Millions of people all over the world never have any
    >>> problems with this limit...

    >>
    >>
    >> And if there's a reason not to alter the file itself? (I can think of
    >> plenty. Copyright; the file is functional, e.g. an executable; the
    >> file is indexed somewhere by hash, so it cannot be altered without
    >> becoming unfindable by another method...)
    >>
    >> Besides, it's been admitted that the limit in the OS internals is
    >> 32000. That truly ought to be enough for anybody. Any stricter limit
    >> is the result of the application layer. Apparently Backup Exec is
    >> awful, awful software, much as we already knew Explorer and its
    >> close cousin Internet Exploder to be...
    >>
    >> But I suppose divergent, changing, arbitrary, random, and too-small
    >> limits are to be expected from Bill "640K" Gates, even now over a
    >> decade after he supposedly learned his lesson.

    >
    > Well?
    >
    > I still don't see anyone suggesting a fix. Why is that?


    Because there isn't a fix dumb****. You can use 256/250 characters
    (inclufing the path) as you've been told. This is programmed into
    Windows. So you have the choice of reprogramming Windows to change it or
    putting up with it like everyone else does..



  12. Re: Windows XP file name length limit

    John of Aix wrote:
    > Phil Cartwright wrote:
    >
    >>Phil Cartwright wrote:
    >>
    >>>Jan Kannemacher wrote:
    >>>
    >>>
    >>>>Anyway. 256 or 260 is usually sufficient, after all the content is
    >>>>supposed to be in the FILE, not the NAME. Anybody who's running into
    >>>>trouble with this limitation shouldn't produce big comments about
    >>>>"broken applications" but give a thought to proper organisation of
    >>>>things. Millions of people all over the world never have any
    >>>>problems with this limit...
    >>>
    >>>
    >>>And if there's a reason not to alter the file itself? (I can think of
    >>>plenty. Copyright; the file is functional, e.g. an executable; the
    >>>file is indexed somewhere by hash, so it cannot be altered without
    >>>becoming unfindable by another method...)
    >>>
    >>>Besides, it's been admitted that the limit in the OS internals is
    >>>32000. That truly ought to be enough for anybody. Any stricter limit
    >>>is the result of the application layer. Apparently Backup Exec is
    >>>awful, awful software, much as we already knew Explorer and its
    >>>close cousin Internet Exploder to be...
    >>>
    >>>But I suppose divergent, changing, arbitrary, random, and too-small
    >>>limits are to be expected from Bill "640K" Gates, even now over a
    >>>decade after he supposedly learned his lesson.

    >>
    >>Well?
    >>
    >>I still don't see anyone suggesting a fix. Why is that?

    >
    > Because there isn't a fix dumb****.


    Excuse me? How rude!

    > You can use 256/250 characters
    > (inclufing the path) as you've been told. This is programmed into
    > Windows. So you have the choice of reprogramming Windows to change it or
    > putting up with it like everyone else does..


    Wrong answer.

    I've already been told that the OS and filesystem support longer. It's
    Explorer that doesn't. Of course most apps use Explorer under the hood
    to display file choose dialogs and the like, so this affects just about
    everything...

    Anyway I find it hard to believe that something like this wouldn't be
    configurable somewhere -- especially given that as I've already noted it
    seems to vary from place to place and from time to time all by its lonesome.

    Regardless, I will not accept useless answers such as "tough". If I ask
    for a workaround for a problem I will be satisfied by a workaround for
    that problem, but not by being ignored, told to simply live with it, or
    fobbed off in any unhelpful way. And I certainly will not be satisfied
    by an insulting response with gratuitous namecalling from a little child
    like you! If you cannot or will not respect your elders when they ask
    for advice, then go play in traffic or something.

    --
    There's only four things you can be certain of: taxes, change, spam, and
    death.

  13. Re: Windows XP file name length limit

    Phil Cartwright wrote:

    >But I suppose divergent, changing, arbitrary, random, and too-small
    >limits are to be expected from Bill "640K" Gates, even now over a decade
    >after he supposedly learned his lesson.


    Oh, he is being punished for this. By having know-it-all customers.




    JK'07

  14. Re: Windows XP file name length limit

    Phil Cartwright wrote:
    > John of Aix wrote:
    >> Phil Cartwright wrote:
    >>
    >>> Phil Cartwright wrote:
    >>>
    >>>> Jan Kannemacher wrote:
    >>>>
    >>>>
    >>>>> Anyway. 256 or 260 is usually sufficient, after all the content is
    >>>>> supposed to be in the FILE, not the NAME. Anybody who's running
    >>>>> into trouble with this limitation shouldn't produce big comments
    >>>>> about "broken applications" but give a thought to proper
    >>>>> organisation of things. Millions of people all over the world
    >>>>> never have any problems with this limit...
    >>>>
    >>>>
    >>>> And if there's a reason not to alter the file itself? (I can think
    >>>> of plenty. Copyright; the file is functional, e.g. an executable;
    >>>> the file is indexed somewhere by hash, so it cannot be altered
    >>>> without becoming unfindable by another method...)
    >>>>
    >>>> Besides, it's been admitted that the limit in the OS internals is
    >>>> 32000. That truly ought to be enough for anybody. Any stricter
    >>>> limit is the result of the application layer. Apparently Backup
    >>>> Exec is awful, awful software, much as we already knew Explorer
    >>>> and its close cousin Internet Exploder to be...
    >>>>
    >>>> But I suppose divergent, changing, arbitrary, random, and too-small
    >>>> limits are to be expected from Bill "640K" Gates, even now over a
    >>>> decade after he supposedly learned his lesson.
    >>>
    >>> Well?
    >>>
    >>> I still don't see anyone suggesting a fix. Why is that?

    >>
    >> Because there isn't a fix dumb****.

    >
    > Excuse me? How rude!


    Tough. You are repeating a question whose answer you have been given.
    That's the way it is in Windows. You can write you own OS if you like,
    or find another one that does what you want but however much yu insist,
    you won't turn water into wine.



  15. Re: Windows XP file name length limit

    John of Aix wrote:
    >>>Because there isn't a fix dumb****.

    >>
    >>Excuse me? How rude!

    >
    > Tough. You are repeating a question whose answer you have been given.


    It's called "asking for a second opinion", and the correct response is
    for someone ELSE to give their opinion about the SYMPTOMS, not for the
    SAME respondent to give an unsolicited opinion about something IRRELEVANT.

    So when I ask for a second opinion after you've given one about the
    symptoms, that doesn't mean you now volunteer one about my intelligence
    or parentage or any other topic on which you see fit; it means you shut
    up and someone else, if they have a different or better idea about my
    original problem, should feel free to speak up.

    Arsehole.

    If I told a doctor I wanted a second opinion, I'd expect a referral to
    another physician, not an insulting and useless response. If I got the
    latter, I'd find another physician myself and the first one would be out
    one customer. In this case, I won't be taking any actual money and going
    elsewhere, but ... I will still be going elsewhere.

    In other words ...

    - PLONK -

    Have a nice day.

    --
    There's only four things you can be certain of: taxes, change, spam, and
    death.

  16. Re: Windows XP file name length limit

    Phil Cartwright wrote:
    > John of Aix wrote:
    >>>> Because there isn't a fix dumb****.
    >>>
    >>> Excuse me? How rude!

    >>
    >> Tough. You are repeating a question whose answer you have been given.

    >
    > It's called "asking for a second opinion", and the correct response is
    > for someone ELSE to give their opinion about the SYMPTOMS, not for the
    > SAME respondent to give an unsolicited opinion about something
    > IRRELEVANT.


    You were given the reply several times by different people yet you
    insisted on repeating the question. For me that is the sign of a
    stubborn dope and I told you so. That that displeases you, of course it
    does, no-one likes to be called a fool, but that's the way I see it and
    I'm not in the least politically correct so I say what I think.



  17. Re: Windows XP file name length limit

    Phil Cartwright wrote:

    >If I told a doctor I wanted a second opinion, I'd expect a referral to
    >another physician, not an insulting and useless response.


    You don't want a second opinion, you want somebody to write what you
    want to see. This is called "ignoring reality".

    As it was already said, ask Microsoft to change it or use another
    operating system. I would suggest the second option, because it would
    spare the Windows newsgroups more of your self-righteous "I want it this
    way, so tell me how it's done".




    JK'07

  18. Re: Windows XP file name length limit

    On Fri, 22 Jun 2007 14:41:40 -0400, Phil Cartwright
    wrote:

    >Phil Cartwright wrote:
    >> Jan Kannemacher wrote:


    >I still don't see anyone suggesting a fix. Why is that?


    Microsoft's "fix" was included in my post. Use \\?\ to access the
    long path/filename

    One way to do this:
    Click START
    Click RUN
    type:
    \\?\C:\Really\Long\Path\To\Really_Long_Filename.ex t
    and press enter.

    Or write your own API. ;-)



  19. Re: Windows XP file name length limit

    Spalls Hurgenson wrote:
    > On Fri, 22 Jun 2007 14:41:40 -0400, Phil Cartwright
    > wrote:
    >
    >
    >>Phil Cartwright wrote:
    >>
    >>>Jan Kannemacher wrote:

    >
    >
    >>I still don't see anyone suggesting a fix. Why is that?

    >
    >
    > Microsoft's "fix" was included in my post. Use \\?\ to access the
    > long path/filename
    >
    > One way to do this:
    > Click START
    > Click RUN
    > type:
    > \\?\C:\Really\Long\Path\To\Really_Long_Filename.ex t
    > and press enter.


    This won't make Explorer let me rename the file, or open it, however.

    --
    There's only four things you can be certain of: taxes, change, spam, and
    death.

  20. Re: Windows XP file name length limit

    A possibly related question:

    I've occasionally run into problems when trying to copy or move files
    on Windows systems where Windows Explorer reports a "filename too long"
    diagnostic and stops copying. Is there any way to configure this so
    that it will continue copying the remaining files in spite of the error?

    When using xcopy this is done with the the "/c" option. However, when
    copying a lot of files xcopy will sometimes abend with an "out of memory"
    error.

    --
    Roger Blake
    (Subtract 10s for email.)

+ Reply to Thread
Page 1 of 2 1 2 LastLast