Subscribe to Windows IT Pro

 

Get Newsletters

  • Get the Latest News
  • Product Updates
  • Helpful Tricks
  • Productivity Tips

Subscribe Now!

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

White Papers

Get your Windows 7 deployment off to the right start by implementing PC lockdown. A locked-down environment is easier and cheaper to support since users are less likely to make unnecessary changes to the core system configuration - read more here!

Essential Guides

Is your iSCSI "lossy"? The reality is that most off-the-shelf Ethernet hardware deployed for iSCSI can lose packets, resulting in slow performance or application downtime. Learn how to assess your current iSCSI infrastructure and engineer an advanced iSCSI SAN infrastructure.

Web Seminars

What's the best way to keep your network safe from malware? In this web seminar, security expert Greg Shields suggests an alternative method to the traditional blacklisting approach that is common with anti-virus and anti-malware solutions.

eLearning Series

We bring the experts direct to you to share their real-world perspective and expertise. During each event, three sessions stream in real time, so you can learn, ask questions, and get solutions.
Upcoming event: Getting the Most with Exchange 2010 with Paul Robichaux

Subscribe to Windows IT Pro!

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