How do I extend the maximum file path size in Windows 7? [duplicate]

Unfortunately the answer is "depends on the program". It is up to the people who write the programs to determine which method they want to use. In fact, (shameless plug) I wrote a blog entry a few weeks ago describing the problem at Explorer still limited by MAX_PATH.

Depending on what you're trying to do you could use another program to manage the long paths, like Microsoft Word. Otherwise, your only other option is to just "live with it" since it's been like that forever and doesn't seem to be changing anytime soon.

Just thought I'd also mention that 64-bit Windows also uses the "Win32" API and CreateFileA for both 32-bit and 64-bit programs have the problem.


EDIT: Geeky Details

The problem exists only in the CreateFileA function and the CreateFileW function when an absolute path with a drive letter is used. The only method to get around it (in code) is to use the \\?\C:\Path\To\File.txt syntax... so even programs that use CreateFileW with a path of C:\Path\To\File.txt have the issue. It's kind of hard to describe but needless to say, the largest reason of programs not internally supporting the \\?\ syntax is they loose the ability to use relative paths (paths like ..\Documents\file.doc).


The SUBST command which is included in Windows 7 will allow access to a longer path via the new virtual drive letter.

Associates a path with a drive letter.

SUBST [drive1: [drive2:]path]

SUBST drive1: /D

drive1: Specifies a virtual drive to which you want to assign a path.

[drive2:]path Specifies a physical drive and path you want to assign to a virtual drive.

/D Deletes a substituted (virtual) drive.

Type SUBST with no parameters to display a list of current virtual drives.


Use a Junction Point to provide a shorter path into a longer path.