Solved

Maximum Path Length - Windows 2000, XP, 2003

Posted on 2004-08-12
6
40,177 Views
Last Modified: 2012-06-22
I have a large file system and am having difficulties with deeper folder levels hitting the maximum path length.  I have seen article talking about the "\\?\" prefix to enable 32,000+ characters, rather than the standard ~255.  I do not know if this can be applied.
I need to use Windows File System normally (i.e. Explorer - via GUI), but with long paths.  Is there any setting (anything else?) that will allow for this?
Thanks if someone can advise...
0
Comment
Question by:DevelopHer
  • 3
6 Comments
 
LVL 20

Expert Comment

by:DVation191
ID: 11784676
In the Windows API, the maximum length for a path is MAX_PATH, which is defined as 260 characters. A path is structured as follows: drive letter, colon, backslash, components separated by backslashes, and a null-terminating character. For example, the maximum path on the D drive is D:\<256 chars>NUL.

The Unicode versions of several functions permit a maximum path length of 32,767 characters, composed of components up to 255 characters in length. To specify such a path, use the "\\?\" prefix. For example, "\\?\D:\<path>". To specify such a UNC path, use the "\\?\UNC\" prefix. For example, "\\?\UNC\<server>\<share>". Note that these prefixes are not used as part of the path itself. They indicate that the path should be passed to the system with minimal modification. An implication of this is that you cannot use forward slashes to represent path separators or a period to represent the current directory. Note also that you cannot use the "\\?\" prefix with a relative path. Therefore, relative paths are limited to MAX_PATH characters.

When using the API to create a directory, the specified path cannot be so long that you could not append an 8.3 file name.

Note that the shell and the file system may have different requirements. It may be possible to create a path with the API that the shell UI cannot handle.

http://msdn.microsoft.com/library/default.asp?url=/library/en-us/fileio/base/naming_a_file.asp
0
 

Author Comment

by:DevelopHer
ID: 11784865
The comment from DVation191 does not help me.  I have read it before (it was pasted here from another thread).  If the "\\?\" prefix is a possibility, I need to know HOW to implement this on an existing file system.  How, where, when do I use the "\\?\" prefix, if this is the answer?
0
 
LVL 20

Expert Comment

by:DVation191
ID: 11785158
Well I didn't copy and paste from another thread...i got it right from the msdn article at the bottom of the post if it makes any difference.
Unfortunately I am not a programmer and have no idea how to use the Windows API to reference a path using the specified prefix. As far as I can tell, being that this functionality is part of the Windows API, it cannot be changed by any means in the Explorer gui.
It does state however, "It may be possible to create a path with the API that the shell UI cannot handle."...of course MS gave no reference to what that possibility might be...sorry DevelopHer
0
 
LVL 2

Accepted Solution

by:
catknows earned 500 total points
ID: 11858013
Using the windows GUI, I don't think you would ever be able to create any filename whole length can be longer than 260 characters (path+filename altogether).

The answer is NO. For sure.  Unless Windows Explorer is rewritten with that capability, either by MS, a third party software or you yourself.
0
 
LVL 20

Expert Comment

by:DVation191
ID: 13573817
Just because you didn't like the answer doesn't mean you should give somebody a "C". Even still, I mentioned the 260 character limit first, which means you accepted the wrong answer anyway.
0

Featured Post

Problems using Powershell and Active Directory?

Managing Active Directory does not always have to be complicated.  If you are spending more time trying instead of doing, then it's time to look at something else. For nearly 20 years, AD admins around the world have used one tool for day-to-day AD management: Hyena. Discover why

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

In a recent article here at Experts Exchange (http://www.experts-exchange.com/articles/18880/PaperPort-14-in-Windows-10-A-First-Look.html), I discussed my nine-month sandbox testing of the Windows 10 Technical Preview, specifically with respect to r…
I use more than 1 computer in my office for various reasons. Multiple keyboards and mice take up more than just extra space, they make working a little more complicated. Using one mouse and keyboard for all of my computers makes life easier. This co…
This is used to tweak the memory usage for your computer, it is used for servers more so than workstations but just be careful editing registry settings as it may cause irreversible results. I hold no responsibility for anything you do to the regist…
Hi friends,  in this video  I'll show you how new windows 10 user can learn the using of windows 10. Thank you.

821 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question