Subscribe to Windows IT Pro
March 16, 2000 12:00 AM

What is the maximum number of characters a filename can be?

Windows IT Pro
InstantDoc ID #13738
Rating: (8)

A. This depends on if the file is being created on a FAT or NTFS partition. The maximum filename length on a NTFS partition is 256 characters, and 11 characters on FAT (8 character name, . , 3 character extension). NTFS filenames keep their case, whereas FAT filenames have no concept of case (however the case is ignored when performing a search etc on NTFS). There is the new VFAT which also has 256 character filenames.

NTFS filenames can contain any characters, including spaces, uppercase/lowercase except for the following

" * : / \ ? < > |

which are reserved for NT, however the file name must start with a letter or number.

VFAT filenames can also contain any characters except for the following

/ \ : | = ? " ; [ ] , ^

and once again the file name must start with a letter or number.

NTFS and VFAT also creates a 8.3 format file name, see Q. How to LFN's work?


Related Content:

ARTICLE TOOLS

Comments
  • Anonymous User
    7 years ago
    Jul 21, 2005

    255 is actually a hard limit for filename length. If you try and put in more, the filename is truncated to the first 255. Not only that, the path+filename also cannot be more than 255 chars. I've run into this limit when I try to export filestructures from a document repository that doesn't have arbitrary limits. This is for win2k, haven't tested on xp or 2k3.

    Bob, Thanks for the tip. You may turn off your capslock now. :)

  • Anonymous User
    7 years ago
    Jul 15, 2005

    The underline character is great to use for forcing my latest or hottest directories or files to the top of the directory listing in LIST mode. IE. ___DIR FOR CURRENT PROJECTS 7-15-05. TRY IT OUT - I USE IT ALL THE TIME. OF COURSE I ONLY DISPLAY DIRFECTORIES IN LLIST MODE, PREVENTING THOSE ANNOYING ICONS FROM CONFUSING WHAT I AM TRYING TO LOCATE. SUBMITTED BY BOBWAYNE@HIWAAY.NET

  • Anonymous User
    7 years ago
    May 29, 2005

    Great info, but your link to "Q. How to LFN's work?" points back to this page...

    What is the depth for subdirectories in Windows also? 224?

    cheers
    Tom
    www.tomax7.com

  • Anonymous User
    8 years ago
    Nov 11, 2004

    Even the chief Microsoft architect can be wrong, the information in the article is not quite correct: one CAN create a file on ntfs with a filename longer than 256 characters, and the filename CAN begin with a + - or other special character. Another question is if it is useful.

  • john
    8 years ago
    Feb 19, 2004

    How about FAT-32? Is that what you mean by VFAT? I have been working with NT for a long time but I still remember that the 9x series could have long file names, more than 8 chars. Maybe I am wrong... Oh and whats with the ~1 thing at the end of directories and files when running older apps or console apps?

You must log on before posting a comment.

Are you a new visitor? Register Here

advertisement

advertisement

Windows is a trademark of the Microsoft group of companies. Windows IT Pro is used by Penton Media Inc. under license from owner.