• What is the REAL PATH length limit in Windows 10?

    Home » Forums » AskWoody support » Windows » Windows 10 » Questions: Win10 » What is the REAL PATH length limit in Windows 10?

    Author
    Topic
    #500664

    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

    Chuck Billow

    Viewing 2 reply threads
    Author
    Replies
    • #1512256

      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

      • #1512262

        Paul, according to my path, ya ain’t gotta do nuttin. I haven’t received any errors…ah well.

        Thanks,
        Chuck

        Chuck Billow

    • #1512301

      Hey Y’all,

      We may be talking apples and oranges, or maybe Path Statement and a File Path as in [noparse]d:dirdirdir…filename.ext[/noparse]

      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” where “” 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 :cheers:

      May the Forces of good computing be with you!

      RG

      PowerShell & VBA Rule!
      Computer Specs

    • #1512307

      … 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?)

      • #1512324

        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

        Chuck Billow

    Viewing 2 reply threads
    Reply To: What is the REAL PATH length limit in Windows 10?

    You can use BBCodes to format your content.
    Your account can't use all available BBCodes, they will be stripped before saving.

    Your information: