Maximum filename length in NTFS (Windows XP and Windows Vista)?
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.
It's 257 characters. To be precise: NTFS itself does impose a maximum filename-length of several thousand characters (around 30'000 something). However, Windows imposes a 260 maximum length for the Path+Filename. The drive+folder takes up at least 3 characters, so you end up with 257.
This is what the "Unhandled exception" says on framework 4.5 when trying to save a file with a long filename:
The specified path, file name, or both are too long. The fully qualified file name must be less than 260 characters, and the directory name must be less than 248 characters.
199 on Windows XP NTFS, I just checked.
This is not theory but from just trying on my laptop. There may be mitigating effects, but it physically won't let me make it bigger.
Is there some other setting limiting this, I wonder? Try it for yourself.