Results 1 to 6 of 6
  1. #1
    Uranium Lounger CWBillow's Avatar
    Join Date
    Jul 2002
    Location
    Las Vegas, NV USA
    Posts
    6,371
    Thanks
    78
    Thanked 12 Times in 11 Posts

    What is the REAL PATH length limit in Windows 10?

    I was looking for something and printed out my PATH statement -- 786 characters. I thought "Wow!"

    With just a cursory search, everything I found, as late as 2014, said the limit was 255 characters?

    Although I understand that the problem goes well beyond a simple code change, IF that limit is true, then:

    1) How come, after all these years, it still is the limit? And, even more importantly -- at least to me --

    2) Is that 786 character PATh even valid? And, if so, how?

    Regards,
    Chuck
    -------------------------------------------------
    "Good judgment comes from experience, and experience - well, that comes from poor judgment."

    ~ A(lan) A(lexander) Milne (1882-1956)- "House at Pooh Corner"

  2. #2
    WS Lounge VIP
    Join Date
    Dec 2009
    Location
    Earth
    Posts
    8,199
    Thanks
    48
    Thanked 987 Times in 917 Posts
    The Windows file name limit has been longer than 255 characters for years, but Windows Explorer was not able to handle names longer than 255 characters. You either had to use a different file manager or cheat with SUBST or DOS commands.
    I don't know the actual limit.

    cheers, Paul

  3. #3
    Uranium Lounger CWBillow's Avatar
    Join Date
    Jul 2002
    Location
    Las Vegas, NV USA
    Posts
    6,371
    Thanks
    78
    Thanked 12 Times in 11 Posts
    Paul, according to my path, ya ain't gotta do nuttin. I haven't received any errors...ah well.

    Thanks,
    Chuck
    -------------------------------------------------
    "Good judgment comes from experience, and experience - well, that comes from poor judgment."

    ~ A(lan) A(lexander) Milne (1882-1956)- "House at Pooh Corner"

  4. #4
    Super Moderator RetiredGeek's Avatar
    Join Date
    Mar 2004
    Location
    Manning, South Carolina
    Posts
    9,436
    Thanks
    372
    Thanked 1,457 Times in 1,326 Posts
    Hey Y'all,

    We may be talking apples and oranges, or maybe Path Statement and a File Path as in d:\dir\dir\dir...\filename.ext

    From HERE:
    On computers running Microsoft Windows*, the PATH environment variable size that you can use is 2047 characters. On computers running Microsoft Windows* 7 and later, the maximum PATH environment variable size that you can use is 4095 characters (but the system restart is required)
    What Chuck was talking about is the Path Statement which us used to set the directories that are searched when a program name is entered and is located in the environment variables list. From command prompt type Set and hit enter and you will see it.

    What Paul was referring to was the length of a path that cam be used in a programming language/program to access a file. This is the item that would cause problems as in File/Windows Explorer.

    Per this MS Article:
    Maximum Path Length Limitation

    In the Windows API (with some exceptions discussed in the following paragraphs), the maximum length for a path is MAX_PATH, which is defined as 260 characters. A local path is structured in the following order: drive letter, colon, backslash, name components separated by backslashes, and a terminating null character. For example, the maximum path on drive D is "D:\some 256-character path string<NUL>" where "<NUL>" represents the invisible terminating null character for the current system codepage. (The characters < > are used here for visual clarity and cannot be part of a valid path string.)
    HTH
    Last edited by RetiredGeek; 2015-06-27 at 11:22.
    May the Forces of good computing be with you!

    RG

    PowerShell & VBA Rule!

    My Systems: Desktop Specs
    Laptop Specs

  5. #5
    Super Moderator
    Join Date
    Jun 2011
    Location
    New England
    Posts
    4,753
    Thanks
    171
    Thanked 652 Times in 575 Posts
    ... so I believe the answer to the question would normally be 8191 characters:


    On computers running Microsoft Windows XP or later, the maximum length of the string that you can use at the command prompt is 8191 characters.

    This limitation applies to the command line, individual environment variables (such as the PATH variable) ...

    Command prompt (Cmd. exe) command-line string limitation (KB830473)


    (But I think it's still 2047 characters if set in System Properties, Advanced, Environment Variables or via the registry: What is the maximum length of an environment variable?)
    Last edited by BruceR; 2015-06-27 at 12:22.

  6. #6
    Uranium Lounger CWBillow's Avatar
    Join Date
    Jul 2002
    Location
    Las Vegas, NV USA
    Posts
    6,371
    Thanks
    78
    Thanked 12 Times in 11 Posts
    And so, RG / Bruce, I think that, for the purposes of the "ordinary" user (yes, I AM one of those), the limit to the path statement -- that environment variable that used to be part of the autoexec.bat file in the old days -- is, if I am understanding this, 2047 characters today, whereas the path for any specific object or file is (still) 255 characters?

    Chuck
    -------------------------------------------------
    "Good judgment comes from experience, and experience - well, that comes from poor judgment."

    ~ A(lan) A(lexander) Milne (1882-1956)- "House at Pooh Corner"

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •