Question Old file with >128-character path won't load in Windows 10 64-bit ?

Pimpom

Distinguished
May 11, 2008
467
31
18,940
Today I tried to open an old electronic PCB design file from my backup thumb drive but received the error message "Unable to find PCB file......[file path]"

The file has a rather long name (28 characters) and is buried deep inside many layers of sub-folders. The full path is 134 characters long. It loads without any problem when I shorten the file name to reduce the path length to 128 characters. Shouldn't the limit be 256 characters?

As a test, I saved a Word file with a long name in the same directory . The path length has 142 characters. This one loads fine in Word.

Is the difference in behaviour due to the fact that my old CAD program is 32-bit whereas MS Word is 64-bit? I didn't think that would make any difference within the same OS.
 
Last edited:

Aeacus

Titan
Ambassador
Shouldn't the limit be 256 characters?
It's 260.
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.
Starting in Windows 10, version 1607, MAX_PATH limitations have been removed from many common Win32 file and directory functions. However, your app must opt-in to the new behavior.

To enable the new long path behavior per application, two conditions must be met. A registry value must be set, and the application manifest must include the longPathAware element.
Source + further reading: https://learn.microsoft.com/en-us/windows/win32/fileio/maximum-file-path-limitation?tabs=registry