• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 2098
  • Last Modified:

MAX_PATH in Windows (path depth character limit)

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
garion1
Asked:
garion1
  • 2
  • 2
1 Solution
 
David Johnson, CD, MVPOwnerCommented:
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
 
garion1Author Commented:
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
 
David Johnson, CD, MVPOwnerCommented:
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
 
garion1Author Commented:
Although I was expecting an answer like this, it gave me clarity on the issue.
0
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

Join & Write a Comment

Featured Post

Cloud Class® Course: Microsoft Windows 7 Basic

This introductory course to Windows 7 environment will teach you about working with the Windows operating system. You will learn about basic functions including start menu; the desktop; managing files, folders, and libraries.

  • 2
  • 2
Tackle projects and never again get stuck behind a technical roadblock.
Join Now