Restricted file and folder names in Windows

I bet you never would have thought that there were names that could not be given to files and folders within Windows… NEITHER DID I. You’re probably thinking Microsoft wants to limit and have control over everything you do on your computer (which might be true in other cases). But the reality is that this is due to technical reasons within Windows which actually date back to the MS-DOS era. But before I cover any technical details, let me list the names that cannot be assigned to files or folders:

  • CON
  • PRN
  • AUX
  • NUL
  • COM1
  • COM2
  • COM3
  • COM4
  • COM5
  • COM6
  • COM7
  • COM8
  • COM9
  • LPT1
  • LPT2
  • LPT3
  • LPT4
  • LPT5
  • LPT6
  • LPT7
  • LPT8
  • LPT9

I bet you’ve already tried to create a folder with one of these names already, and received an error. Now depending on which version of Windows (or MS-DOS if you can’t run Windows on your 1983 Intel 286 desktop) you are using, you’ll get an error message with a slightly different message. Windows 10 will report an invalid device name, MS-DOS will report a duplicate file name.

Screenshot 2019-03-16 at 23.52.55

But what is preventing us from doing this? The names listed above are files that actually exist in system. WHAT?? Let me explain…

As an example let’s use the file LPT1. If you were able to get notepad to save data (plain text) to LPT1, it would actually send this data to port LPT1. LPT or Line Print Terminal is a (definitely old) printer port that allowed your computer (your computer is definitely old if it has one) to send bytes of data and plain text to the printer to be printed on paper. See the picture below…

Image result for lpt

Those were the days

Basically LPT1 isn’t technically a file stored on the computer, but is set up that way so that programs don’t have to implement more advanced programming of printer routines. Instead they just print or “save data” to a file and it would print at the printer.

By the way, the numbers next to LPT or COM are there because systems could have several of the same ports onboard (As mentioned earlier, if you have at least one of these traditional ports your computer is old, let alone multiple).

CON is the same thing except anything saved to it would print in the command prompt or just on your screen if your were using MS-DOS (a.k.a the fullscreen command prompt that was before windows). It’s short for CONsole which is what a command prompt is displaying.


Fill in your details below or click an icon to log in: Logo

You are commenting using your account. Log Out /  Change )

Google photo

You are commenting using your Google account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s