Skip to content

Why after more than 40 years you can’t name a file “con” in Windows 10

26 mayo, 2021

The short answer is backward compatibility. We know that in a company like Microsoft it is sometimes impossible to get rid of something, and this is because one of the best parts of Windows is sometimes also its drag: the fact that the system continues to support software and devices as old as those from the era of MS-DOS or Windows 3.1, even today.

Windows 10 has some features that today can be considered a bug, “errors” that have not been “resolved” for more than 40 years because they were actually intentional in a time when things worked differently. This is what happens when you try to name any file in Windows with terms like “CON”, “LPT1”, “PRN”, “NUL” or “AUX”. Not possible by design.

The forbidden words

You can try for yourself right now, try to create a folder or text document, or even rename an image to something like CON.png or AUX.txt. Windows 10 will give you an error message asking you to change the name and that the device name is invalid.

"It is impossible to get rid of something at Microsoft": The Creator of Windows 8 Explains Why the Best of Windows is Also Its Ballast

But which device? In the age of MS-DOS (Microsoft’s version of DOS) in the 80’s, computers were basically a black screen with text and nothing else. So everything worked by writing orders. For a program to interact with other things, such as a printer, a command had to be written using a text file or “device file” that would interact with a driver.

Logo 40

Depending on the device, it has a name reserved. For example, parallel ports that printers used to connect to use LPT1, LPT2, LPT3, LPT4, LPT5, LPT6, LPT7, LPT8, and LPT9. The serial ports had reserved COM from 1 to 9. CON represents the console, and so on several more.

To this day those device names are reserved so that you cannot create usable files or folders with them, because it turns out that those devices can be treated as a file. If back then you tried to do something like create a file called LPT1.txt, what you were going to do was send it to the printer or something like that and that’s why they were blocked.

File Name Not Valid

A Microsoft engineer explains what Windows 10 looks like on the inside: the code occupies 0.5 TB and spans 4 million files

If in Windows 10 you open the terminal and use a command like COPY CON genbeta.txt, what happens is that whatever you write from now on in the console will go to that text file “genbeta.txt”.

Windows 10 retains code from the days of Windows 3.1, and Windows 3.1 was created with MS-DOS as basic, as was Windows 95. With Windows NT this did not happen, but still Microsoft wanted it to be compatible with Windows 95, and Windows 10 is still partly based on Windows NT, and the same goes for Windows 7, or Windows 8.

Almost no one may use a parallel port to connect a printer anymore, but Microsoft chooses to continue to support extremely old software and devices to this day, and that’s why Windows code is an eyesore born of an almost obsessive commitment to backward compatibility who has the occupies, a creature It occupies 0.5 TB and spans 4 million files.