Windows â€œreservesâ€� certain file names and doesnâ€™t let you use them anywhere. Forget calling a file â€œcon.txtâ€� or â€œaux.mp3â€�. This is all because of a choice made in 1974 and Microsoftâ€™s thirst for eternal backward compatibility.
File Names You Canâ€™t Use
Microsoft provides an official list of reserved file names, and here they are:
CON, PRN, AUX, NUL, COM1, COM2, COM3, COM4, COM5, COM6, COM7, COM8, COM9, LPT1, LPT2, LPT3, LPT4, LPT5, LPT6, LPT7, LPT8, and LPT9
Note that you canâ€™t use these file names with any file extension. So you canâ€™t name a file â€œcon.txtâ€�, â€œcon.jpgâ€�, â€œor â€œcon.docâ€�. And Windows isnâ€™t case sensitive, so it doesnâ€™t matter whether itâ€™s CON, con, or CoNâ€”Windows wonâ€™t let you use that name.
You can try it yourself. Try saving a file as â€œcon.txtâ€� or â€œlpt6.txtâ€� in Notepad. Or try renaming any file to one of these names in File Explorer. Windows just wonâ€™t let you do it.
Of course, Windows also restricts file names in other ways. You canâ€™t use various special characters like the following in names, either.Â Consult Microsoftâ€™s officialÂ documentation for more information.
What Happened in 1974, and Why Should We Care?
It is 2018 and this error message is a mistake from 1974.
This limitation, which is still found in the very latest Windows 10, dates back to BEFORE STAR WARS. This bug is as old as Watergate. pic.twitter.com/pPbkZiE57t
â€” foone (@Foone) November 3, 2018
As @Foone recently explained on Twitter, this issue dates back to 1974. In UNIX, â€œeverything is a file.â€� (The same is true in UNIX-likeÂ operating systems like Linux today.) Hardware devices were represented at special paths like /dev/lp0 for the first printer and /dev/tty for the console.
In 1974, this same concept was added to the CP/M operating system. Unfortunately, CP/M was designed for computers with very little memory and no hard drives. It used multiple disks and no directories, so those special files representing devices effectively appeared everywhere, on every disk.
So, when you were saving a text file, you could tell your text editor to â€œsaveâ€� it to the printer device, which would print it. But text editors and other programs like adding file extensions like â€œ.txtâ€�, so CP/M just ignored the file extension for these device files. In other words, if a text editor tries saving a file to the name of the printer device followed by â€œ.txtâ€�, CP/M just assumed it was referring to the printer device and ignored the file extension. Now the feature worked properly in every applicationâ€”great!
Sure, itâ€™s a dirty hack, but who cares? Well, CP/M caught on. Eventually, PC-DOS came along, and it kept that useful CP/M feature. PC-DOS 2.0 added directories back in 1983, but Microsoft chose to have these device files appear in all directories for compatibility with existing DOS software rather than place them in a special device folder.
Eventually, Windows 95 came along, and it was built on top of DOS. Windows NT wasnâ€™t based on top of DOS, but it did want to be backward compatible with Windows 95 applications. Windows 10 is still based on Windows NT, and it works the same way. The same applies on Windows 7, of course.
Now, itâ€™s over forty years later and we still canâ€™t name files â€œcon.txtâ€� or â€œaux.mp3â€� because Windows wants to stay compatible with ancient programs that might be using this feature. Itâ€™s a good example of how intensely Microsoft is committed to backwards compatibility.
Update: Weâ€™ve been told that CP/M originally required a trailing colonâ€”in other words, rather than â€œCONâ€�, you had to type â€œCON:â€�. Apparently, the problem may have really started in 1981 with the release of MS-DOS and PC-DOS, which removed the colon requirement. In DOS, you could use â€œCONâ€� instead of â€œCON:â€�. So perhaps DOS is more to blame for this than CP/M is.
The post Windows 10 Still Wonâ€™t Let You Use These File Names Reserved in 1974 appeared first on TechFans.