started · updated
Windows 11 maintains legacy file naming restrictions from MS-DOS era
Windows 11 continues to enforce file naming restrictions that date back to the MS-DOS era. Users are prevented from naming files or folders using specific reserved keywords such as “CON”, “PRN”, “AUX”, and “NUL”, as well as ranges like “COM1” through “COM9” and “LPT1” through “LPT9”.
These restrictions originated from early operating systems like CP/M and MS-DOS 1.0, where these terms were reserved for hardware devices: “CON” for the console, “PRN” for the printer, “COM” for serial ports, and “LPT” for parallel ports. Microsoft developer Raymond Chen has noted that maintaining these legacy rules is necessary to avoid breaking existing programs and scripts that rely on these reserved names for specific functions, such as using “NUL” to discard output.
While Microsoft documentation suggests that reserved names with extensions (e.g., “NUL.txt”) should also be restricted, some testing on Windows 11 26H2 indicates that certain files with extensions can be created, though they may still exhibit unexpected behavior in environments like PowerShell.