Windows 11 26H2 doesn't allow to name a folder CON, a rule that dates back to DOS You can give a file in Windows 11 a 200-character name full of spaces and emojis, but heaven forbid you try naming a file or folder CON, because File Explorer will flat-out refuse. CON, PRN, AUX, NUL, COM1 to COM9 and LPT1 to LPT9 are reserved device names, and Microsoft engineer Raymond Chen tracks their origin to DOS 1.0, a version that didn’t even have folders!
I tried it on my PC running Windows 11 26H2, and the rule that the OS from 1981 started with is still very much there, although Windows Latest found that a part of it no longer works the way Microsoft’s documentation says.
File Explorer on Windows 11 26H2 showing an error after trying to rename a folder to CON. Credit: Windows LatestEach reserved name corresponds to a device, and NUL is my favourite: a black hole that swallows anything you send to it.
Reserved nameWhat it points toCONConsole (keyboard and screen)PRNPrinterAUXAuxiliary deviceNULNull device (discards output)COM1 to COM9Serial portsLPT1 to LPT9Parallel (printer) ports
Microsoft’s file naming documentation still tells developers, “Do not use the following reserved names for the name of a file,” and the rules apply to folders too, since Windows thinks of a folder as a special type of file.
Windows 11 refusing to rename a folder as PRN. Credit: Windows LatestAdding an extension isn’t supposed to help (Spoiler alert! It does in some cases). According to Microsoft, “NUL.txt and NUL.tar.gz are both equivalent to NUL.” Even superscript digits are not exempt, as Windows reads ¹, ² and ³ as digits, so COM¹ and LPT³ are reserved “in every directory.”
Architecturally, COM1 is a link to the serial port inside the Windows kernel, which Microsoft calls an MS-DOS device name, so typing COM1 reaches the port, not a file.
The story starts with CP/M, the operating system MS-DOS tried to stay compatible with, where device names always came with a colon, like CON:. MS-DOS made the colon optional, which Michal Necasek of the OS/2 Museum calls the “fatal flaw,” since a plain name like CON doesn’t tell DOS whether you mean a file or the console.
Sanco 8001 computer, running under CP/M 2.2 (1982). Source: Michael SpechtIn a 2003 post on his Old New Thing blog, Chen explains that “DOS 1.0 didn’t support subdirectories, lowercase, or filenames longer than 8.3,” which also happens to be the strange reason why Windows 11’s oldest system files still have DOS-era names.
Back then, if an assembler asked where to save its output and you wanted a printout, “you typed ‘PRN’ as the filename.” Typing NUL threw the output away, and CON put it on the screen.
With only one directory on the disk, there was nowhere else for the magic names to work. Once we got folders in 1983 with DOS 2.0, Chen mentioned that if the names didn’t work inside them, you couldn’t switch to a folder, run the assembler, and type NUL to get rid of the output. So, Microsoft made the names work in every single folder, and that decision is why your Documents folder can’t have a file called PRN today.
So why hasn’t Microsoft cleaned up this mess in over 40 years? “Because everybody still relies on them,” Chen wrote. Batch files hide output by redirecting it to >NUL, scripts check whether a folder exists with “if exist directoryname\nul,” and old guides tell you to create files with “copy CON.”
As a coincidence, if the rule is removed, every script that redirects to NUL would start writing real files.
Interestingly, the rule once took down whole PCs. Windows 95 and 98 rejected a path with one device name but choked on a path with two, like C:\con\con, and Microsoft’s MS00-017 bulletin from March 2000 admits that it “usually results in a crash.”
On my PC running Windows 11 26H2, renaming a new folder to CON gave me “The specified device name is invalid,” and PRN, AUX, NUL and COM1 got rejected too.
However, NUL.txt went through without a complaint, and so did CON.txt, even though Microsoft’s documentation still says NUL.txt equals NUL.
File Explorer on Windows 11 26H2 showing NUL.txt and CON.txt created as normal files Credit: Windows LatestWell, if Microsoft isn’t updated, developers who dug into Python’s Windows support noticed back in 2022 that Windows 11 stopped treating device names with an extension as special when it processes file paths.
Unfortunately, such files can act strangely. One user on Microsoft Q&A found that PowerShell could list NUL.txt but couldn’t open or delete it, and a community advisor replied that “the result may be unpredictable.” Maybe that’s why Microsoft insisted NUL.txt and CON.txt don’t care about the extensions.
Developer found that reserved file name suffixed by an extension name cannot be parsed to the corresponding NT PathFor a bit of fun, you can use Command Prompt to show the old DOS magic. Running echo hello > CON printed “hello” on screen instead of creating a file, and echo test > COM¹ failed, just like Microsoft documents.
But before you bash Windows, know that in 2024, Linux maintainers renamed a graphics driver file from aux.c to auxch.c, because the name stopped people from cloning the Linux kernel on Windows.
And now you can criticize Windows, because Linux changed its code for Windows, while Windows won’t drop a 1981 rule for scripts nobody has touched in decades.
However, Windows 11 did relax the rule just enough to let NUL.txt through, but CON is still considered a device, and not a file name. Like the Windows 95 heap manager that still ships in Windows 11, it’s one more relic Microsoft can’t remove without breaking someone’s 30-year-old batch file.