And this is why it gets confusing:
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.
So I guess that means the most you can use is 256 characters, even though the limit is 260.
D:\256
<NUL>The Windows API has many functions that also have Unicode versions to permit an extended-length path for a maximum total path length of 32,767 characters. This type of path is composed of components separated by backslashes, each up to the value returned in the lpMaximumComponentLength parameter of the GetVolumeInformation function (this value is commonly 255 characters). To specify an extended-length path, use the "\\?\" prefix. For example, "\\?\D:\very long path".
Note The maximum path of 32,767 characters is approximate, because the "\\?\" prefix may be expanded to a longer string by the system at run time, and this expansion applies to the total length.
So in certain cases, you oculd actually support considerably longer than 256 characters. (why Explorer and the rest of Windows hasn't moved beyond this yet, is beyond me)
And further on:
When using an API to create a directory, the specified path cannot be so long that you cannot append an 8.3 file name (that is, the directory name cannot exceed MAX_PATH minus 12).
So that would be... 248 characters? (or possibly 244?)
?
EDIT: Did a little testing. It's 244 characters - at least that's the maxmimum length name Explorer lets me use for a folder on the root of a drive.
I can't move or create any folders/files inside that directory - but I
can move files with up to 11 characters in their name into it.