this post was submitted on 22 Jun 2023
611 points (99.2% liked)

Memes

45746 readers
1553 users here now

Rules:

  1. Be civil and nice.
  2. Try not to excessively repost, as a rule of thumb, wait at least 2 months to do it if you have to.

founded 5 years ago
MODERATORS
 
you are viewing a single comment's thread
view the rest of the comments
[–] [email protected] 1 points 1 year ago (2 children)

Also, you cannot create a file named "con" in Windows, even in the latest versions. It's a holdover from DOS where that word was reserved for the console. For example, you could type "copy con file.txt" to quickly create a text file from the command line and start entering text.

[–] [email protected] 1 points 1 year ago* (last edited 1 year ago)

There's another interesting fact here: MS-DOS 1.0 didn't have directories.. To print a text file, you could just do TYPE foo.txt > LPT1, since LPT1 wasn't in a directory (like /dev on Linux).

MS-DOS 2.0 added directories. However, to remain backwards compatible with 1.0, devices were still "global". You could still run TYPE foo.txt > LPT1 regardless of which directory you were in.

This is why you can't create files names CON, LPT1, etc. in Windows. They're reserved globally, which is a holdover from the original MS-DOS version from 1983.

[–] [email protected] 1 points 1 year ago* (last edited 1 year ago)

You actually can, if you bypass some translation. \\?\C:\CON is a perfectly valid file path…and creating a file at that path will prevent almost all software from opening it! You can see it in File Explorer, but you can't delete it without a command prompt.