1

How is it possible for file paths exceeding 256 characters to be created in the first place if 256 characters is the maximum length Windows can recognize?

We are running SBS 2003 and I am currently dealing with problems caused by users creating subfolders on network shares with very long descriptive names. As these names get longer over time and subsfolders are created inside them, we eventually end up with folders at the bottom of the folder hierarchy with paths exceeding the 256 character limit (some paths are now over 320 characters in total).

My question: if a file path exceeding 256 characters is too long, then how is it possible for users to create these excessively long paths in the first place without getting an error from Windows?

(Workstation OS version = Windows 7; server OS = SBS 2003)

Hopefully, once I understand how this is possible, I will be able to deal with the problem of these long paths being created more effectively in future.

Kevin Panko
  • 7,366
  • One simple way is for me to create a path like c:\xxxxxxxxx... that's 250 characters long and then mount my c drive as \\VeryLongShareNameHere. Or I can mount c:\foobarbaz\barbaz\bazqux\quux as share foo and then create long filenames as foo\\<stuff>. – David Schwartz May 21 '14 at 20:00
  • Thanks, David. Good point. There are probably a few other ways like that that could do it. – Austin ''Danger'' Powers May 21 '14 at 20:20
  • @techie007, I really wish the unicode answers on that question would get more upvotes. The maximum path is 32,767 bytes when software uses the unicode api. – Zoredache May 21 '14 at 23:35
  • 1
    @Austin''Danger''Powers, what are the problems you are having with these longer paths? Most of the problems can be worked around with specific tools. Robocopy for example uses the unicode apis for and can handle 32k length paths. One thing that bugs me is the lack of long path support in Powershell. – Zoredache May 21 '14 at 23:39
  • @Zoredache the problem is that files in network locations where they have an excessively long file path cannot be opened by users when they double click on them (users think the data is simply corrupted). In addition, these files cannot be moved, copied or deleted in Explorer and the right click context menu options are greatly limited. I will include screenshots in the question to show what I mean by this. – Austin ''Danger'' Powers May 23 '14 at 20:30

0 Answers0