Take the 2-minute tour ×
Super User is a question and answer site for computer enthusiasts and power users. It's 100% free, no registration required.

Possible Duplicate:
What is the longest file path that Windows can handle?

Does anybody know if it is possible to extend the maximum path length in Windows 7 (64-bit)?

share|improve this question
add comment

marked as duplicate by Bobby, Diago Oct 23 '10 at 7:00

This question has been asked before and already has an answer. If those answers do not fully address your question, please ask a new question.

4 Answers

up vote 16 down vote accepted

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).

share|improve this answer
    
Sigh Yes, I was using Windows Explorer. It seems odd to me because I was usually able to create extremely long file paths in Windows XP without trouble (I never got the long path error in XP. Not once!). Oh well –  Cameron Sep 8 '09 at 13:29
2  
Yeah, there are varying ways to get around the issue, none of them seem to work 100% though. Honestly I find the problem to be a huge issue since we're keeping more and more files. It really gets me when Word can save to a long path just fine, but when you use explorer to copy it dies with a "The path name is too long for the destination" –  Joshua Sep 8 '09 at 13:32
    
Thanks for the "geeky details", they're very interesting (and somewhat make sense) to me because I am a student programmer (I haven't really used the Win32 API yet though) –  Cameron Sep 10 '09 at 13:08
    
Funny, I got that long path error all the time in XP/2003. –  surfasb Jul 19 '11 at 7:24
add comment

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.

share|improve this answer
add comment

The Win32 API limits a file path to 255 characters (including the drive letter). No, you cannot increase that limit. If you need more, you're probably trying to solve your problem the wrong way.

share|improve this answer
    
I forgot to mention I am using 64-bit Windows 7 –  Cameron Sep 8 '09 at 13:09
1  
64-bit is apparently irrelevant –  Cameron Sep 8 '09 at 13:32
    
Yup, unless they wrote a Win64 for 64bit Windows 7, then it could be 256 bits Windows for all that matters. –  surfasb Jul 19 '11 at 7:23
    
The API supports 32k characters in a path. Certain API calls do not. –  EKW Jul 30 '12 at 13:19
    
That's real smart... "... your using it the wrong way" because microsoft was not smart enough to realize that the path might ever be longer than 255? –  AbstractDissonance Aug 20 '12 at 3:56
show 2 more comments

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

share|improve this answer
add comment

Not the answer you're looking for? Browse other questions tagged or ask your own question.