?
Solved

MAX_PATH in Windows (path depth character limit)

Posted on 2012-08-24
4
Medium Priority
?
2,018 Views
Last Modified: 2012-10-11
I need some clarity on MAX_PATH in Windows.
We primarily work on Windows 7 32bit machines with basic NTFS file systems.

I understand that the path depth character limit in Windows is 260, including the NULL terminator. I also understand that the NTFS file system itself allows approximately 32,767 characters in a path. Certain Windows API Unicode functions permit an extended-length path up to this limit as well.

I was backing up (Copying) files, with full paths, from a Windows 7 laptop to a folder on a Windows 2003 server (NTFS) today and it would not allow me to copy certain files as the path limit had been exceeded. The longest, including file name was 309 characters. I had to shorten some folder and file names in order to copy them across.

What I don't understand is if Windows only allows 259 visible characters, why does it allow a user to create a path depth, including file name, greater than 260 characters?

What other challenges, besides copying, can we face if users are exceeding their path limits?
0
Comment
Question by:garion1
  • 2
  • 2
4 Comments
 
LVL 84

Accepted Solution

by:
David Johnson, CD, MVP earned 1000 total points
ID: 38329995
it is not a ntfs restriction but an explorer restriction (MAX_PATH) .. NTFS allows up to 32.767 characters. It is a common pet peeve in windows.

http://msdn.microsoft.com/en-us/library/aa365247.aspx
0
 

Author Comment

by:garion1
ID: 38336729
Thanks ve3ofa. I did read this article before posting this.
I still don't understand why Windows 7 Explorer allows one to create an extended path without specifying \\?\.
0
 
LVL 84

Expert Comment

by:David Johnson, CD, MVP
ID: 38339422
What I don't understand is if Windows only allows 259 visible characters, why does it allow a user to create a path depth, including file name, greater than 260 characters?
Bill Gates: no one will need more than 640K of memory..


What other challenges, besides copying, can we face if users are exceeding their path limits?

Technically they shouldn't be able to ... This is a persistent bug, that I keep hoping each new version of Windows will address.
0
 

Author Closing Comment

by:garion1
ID: 38486019
Although I was expecting an answer like this, it gave me clarity on the issue.
0

Featured Post

Keep up with what's happening at Experts Exchange!

Sign up to receive Decoded, a new monthly digest with product updates, feature release info, continuing education opportunities, and more.

Question has a verified solution.

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

This article provides a convenient collection of links to Microsoft provided Security Patches for operating systems that have reached their End of Life support cycle. Included operating systems covered by this article are Windows XP,  Windows Server…
In the absence of a fully-fledged GPO Management product like AGPM, the script in this article will provide you with a simple way to watch the domain (or a select OU) for GPOs changes and automatically take backups when policies are added, removed o…
Windows 10 is mostly good. However the one thing that annoys me is how many clicks you have to do to dial a VPN connection. You have to go to settings from the start menu, (2 clicks), Network and Internet (1 click), Click VPN (another click) then fi…
Finding and deleting duplicate (picture) files can be a time consuming task. My wife and I, our three kids and their families all share one dilemma: Managing our pictures. Between desktops, laptops, phones, tablets, and cameras; over the last decade…

809 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