Understanding Windows 10's Filename Limitations: Comprehensive Guide
Windows 10 has several limitations when it comes to naming files and folders. Understanding these limitations can help you avoid errors and ensure that your files are easily accessible. In this guide, we will cover the key concepts related to Windows 10's filename limitations.
Maximum Length of a Filename
In Windows 10, the maximum length of a filename, including the file extension, is 260 characters. This limit includes the path to the file, so if the file is located deep within a directory structure, you will have fewer characters available for the filename itself. It's important to note that this limit applies to the Windows API, and some applications may impose additional restrictions.
Invalid Characters in Filenames
Windows 10 does not allow certain characters to be used in filenames. The following characters are not allowed:
< / > : " | ? *
In addition to these characters, Windows 10 also does not allow filenames to begin or end with a space or a period. These restrictions are in place to prevent errors and ensure that files can be accessed reliably.
Reserved Names
Windows 10 reserves certain names for use by the system. These names are not allowed to be used as filenames or folder names. The following names are reserved:
CON, PRN, AUX, NUL, COM1, COM2, COM3, COM4, COM5, COM6, COM7, COM8, COM9, LPT1, LPT2, LPT3, LPT4, LPT5, LPT6, LPT7, LPT8, and LPT9
Long Filenames (LFNs) and Short Filenames (SFNs)
Windows 10 supports both long filenames (LFNs) and short filenames (SFNs). LFNs can be up to 260 characters long, while SFNs are limited to 8.3 characters. SFNs are used by older applications that do not support LFNs. When a file is created with an LFN, Windows 10 automatically generates an SFN for compatibility purposes. However, it's important to note that the SFN may not be an exact match for the LFN, and this can lead to errors when accessing the file.
Understanding Windows 10's filename limitations is important for ensuring that your files are accessible and free from errors. The key concepts to keep in mind are the maximum length of a filename (260 characters), the invalid characters that cannot be used in filenames (<, >, :, ", |, ?, *, /, \, and space), the reserved names that cannot be used as filenames or folder names, and the difference between long filenames (LFNs) and short filenames (SFNs).
References
- Microsoft. (2021). Naming files, paths, and namespaces. https://docs.microsoft.com/en-us/windows/win32/fileio/naming-a-file
- Microsoft. (2021). Maximum Path Length Limitation. https://docs.microsoft.com/en-us/windows/win32/fileio/maximum-file-path-limitation
- Microsoft. (2021). Reserved Names. https://docs.microsoft.com/en-us/windows/win32/fileio/naming-a-file#reserved-names