<p>Quoting this article <a href="https://learn.microsoft.com/en-us/windows/desktop/FileIO/naming-a-file#maximum-path-length-limitation">https://learn.microsoft.com/en-us/windows/desktop/FileIO/naming-a-file#maximum-path-length-limitation</a></p>
<p><strong>Maximum Path Length Limitation</strong></p>
<p>In the Windows API (with some exceptions discussed in the following paragraphs), the maximum length for a path is <strong>MAX_PATH</strong>, 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. Par exemple, 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.)</p>
<p>Now we see that it is 1+2+256+1 or [drive][:][path][null] = 260. One could assume that 256 is a reasonable fixed string length from the DOS days. And going back to the DOS APIs we realize that the system tracked the current path per drive, and we have <a href="http://en.wikipedia.org/wiki/Drive_letter_assignment">26 (32 with symbols) maximum drives</a> (and current directories).</p>
<p>The INT 0x21 AH=0x47 says “This function returns the path description without the drive letter and the initial backslash.” So we see that the system stores the CWD as a pair (drive, path) and you ask for the path by specifying the drive (1=A, 2=B, …), if you specify a 0 then it assumes the path for the drive returned by INT 0x21 AH=0x15 AL=0x19. So now we know why it is 260 and not 256, because those 4 bytes are not stored in the path string.</p>
<p>Why a 256 byte path string, because 640K is enough RAM.</p>