Link to home
Start Free TrialLog in
Avatar of DevelopHer
DevelopHer

asked on

Maximum Path Length - Windows 2000, XP, 2003

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...
Avatar of DVation191
DVation191

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
Avatar of DevelopHer

ASKER

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?
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
ASKER CERTIFIED SOLUTION
Avatar of catknows
catknows

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
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.