Maximum Path Length Limitation
Hi, According to http://msdn.microsoft.com/en-us/library/aa365247%28VS.85%29.aspx. The Windows API has many functions that also have Unicode versions to permit an extended-length path for a maximum total path length of 32,767 characters. To specify an extended-length path, use the "\\?\" prefix. For example, "\\?\D:\<very long path>". It also states that the "\\?\" prefix can also be used with paths constructed according to the universal naming convention (UNC). For example, "\\?\UNC\server\share", where "server" is the name of the computer and "share" is the name of the shared folder. I can't get the "\\?\UNC\servername\sharename" to work at all. It always comes back and say "The filename, directory name, or volume label syntax is incorrect." Can anyone help to tell me what's wrong with my syntax or this is just something doesn't work at all? Thank you!
February 18th, 2010 2:04am

I can attest to the fact that this syntax you are using does work. I just validated it using local and network paths. I received no errors when accessing paths that were correct. Could it be that you are using certain characters in your path that are not supported. See Article:http://technet.microsoft.com/en-us/library/cc956689.aspxExplanation: The system does not accept the keyboard combination Alt+0 through Alt+32 or the following characters: \\ \\ / [ ] : | < > + ; = . ? " Visit my blog: anITKB.com, an IT Knowledge Base.
Free Windows Admin Tool Kit Click here and download it now
February 18th, 2010 5:09am

Hi, Can you tell me what client OS and server OS you are running this command on? I have tested both the local and network paths, only the local path works. Can you provide me an example of the network path you test? Thank you.
February 23rd, 2010 1:33am

I quickly tested this on a Windows XP and 7 workstation. I have access to other operating systems if you need some additional testing.I used the format exactly accorinding to your post.For the local path, I typed \\?\C:\Documents and Settings\All Users\Start Menu\Programs\Administrative Tools\This is a test file with a really long name to test this path.txtFor a network path, I typed \\?\UNC\Server01\MyShare\ThisIsATestFileWithAReallyLongNameToTestThisPath.txt Visit my blog: anITKB.com, an IT Knowledge Base.
Free Windows Admin Tool Kit Click here and download it now
February 23rd, 2010 2:41am

Hi, Okay, I can type "type \\?\unc\servername\sharename\path\file.txt". I guess what I don't understand is why I can't do a directory list like "dir \\?\unc\servername\share\path" for a network path. It works fine with a local pth. Thanks again.
February 24th, 2010 11:39pm

The DIR command supports that with a local path. If it was allowed for a UNC path, then it would work as well if you typed "dir \\servername\sharename". Visit my blog: anITKB.com, an IT Knowledge Base.
Free Windows Admin Tool Kit Click here and download it now
February 25th, 2010 3:35am

Thanks for your input. The goal to me is trying to delete some network folders that has a very long path and name in it. When I do a "rd \\servername\share\path\folder /s", I got an error saying path too deep or something like that. I think if I can't do a "dir \\?\unc\sername\share\path" I probably won't be able to do a "rd \\?\unc\servername\share\path /s" Thanks.
February 26th, 2010 12:31am

Wow2009, \\?\unc\servername\sharename\path\file.txt by itself will not work. Normally the program associated with TXT files would launch, but using this long name provider that does not work. But this is a separate issue. However, the follwing will work.Notepad \\?\unc\servername\sharename\path\file.txtAnother Example: Notepad \\?\c:\boot.iniAll the examples everyone is giving you have COMMAND \\?\path.
Free Windows Admin Tool Kit Click here and download it now
February 26th, 2010 12:55am

This topic is archived. No further replies will be accepted.

Other recent topics Other recent topics