Maximum filename length in NTFS (Windows XP and Windows Vista)?

GateKiller picture GateKiller · Nov 5, 2008 · Viewed 476k times · Source

I'm designing a database table which will hold filenames of uploaded files. What is the maximum length of a filename in NTFS as used by Windows XP or Vista?

Answer

Adam Rosenfield picture Adam Rosenfield · Nov 5, 2008

Individual components of a filename (i.e. each subdirectory along the path, and the final filename) are limited to 255 characters, and the total path length is limited to approximately 32,000 characters.

However, on Windows, you can't exceed MAX_PATH value (259 characters for files, 248 for folders). See http://msdn.microsoft.com/en-us/library/aa365247.aspx for full details.