In Windows:

When trying to create a "con" folder or "con.xxx" file it says:
Cannot create or replace file: The filename you specified is too long. Specify a different filename.

When trying to open the "con" file in any application, you get the Blue Screen of Death, and the application (and sometimes Windows itself) crashes.


In DOS:

C:\>md con
Unable to create directory

C:\>cd con
Invalid directory

C:\>rd con
Invalid path, not directory
or directory not empty

C:\>del con
Access denied

C:\>md con.aaa
Unable to create directory

C:\>


Using Winamp:

E:\Winamp\Playlists\con
This file is a reserved device name.
Please choose another name.


Why is it that Windows hogs the con file name? (besides the fact that it was made by Microsoft)
Apparently, "con" is a reserved word in FAT or win32? Theories:

  1. "con" is a magic name for the console?
  2. "con" is the name for magic data storage.
A very brief search on MSDN turns up nothing. I have my money on #1.
An internet search on google for con "invalid directory" gives us some interesting results:

  • In http://taz.cs.ubc.ca/swift/fun/vf/VFSetup2.txt:

    fc con nul /lb1 /n | date | find " 1: " > temp.bat
  • On http://ourworld.compuserve.com/homepages/r_harvey/doc_dos.htm#Lbl19, we find the real paydirt:

    MS-DOS automatically installs several devices when you boot the computer: MS-DOS Devices Device Purpose COM1 The serial and infrared ports. CON The console (display and keyboard). LPT1 Line printer, usually a parallel port. Same as COM1 on the HP 95. NUL The null device (everything is discarded). PRN The printer (usually a parallel port, though on the HP 95, the serial port).

    In everyday use, we treat devices like files. If you want to print a file, you could send it to the PRN device. This will not create a file named PRN, but it instead passes the information to the device driver with that name:

     COPY CONFIG.SYS PRN
    
    The CON device represents the console, both the display and keyboard -- it can both receive and send data. We call the keyboard Standard Input, or StdIn for short. The display is Standard Output, also known as StdOut. Together they are the CON device. These distinctions, and the console device driver, will seem more important and even useful in a few minutes, when we talk about redirection. Using the CON device, we can use COPY like TYPE:

     COPY CONFIG.SYS CON
    
    This sends the file to the console, and displays "1 File(s) copied" when it's done. The other side of the console is StdIn; we can create short text files from the keyboard without running any text editor:

     COPY CON HELLO.TXT
    
    Now MS-DOS will record your keystrokes in a file named HELLO.TXT. Every time you press ENTER, DOS adds another line to the file. To stop recording text, press F6 or CTRL+Z to enter the end of file character. DOS will again display "1 File(s) copied."

    - From Explorer's Guide to the HP95, on http://ourworld.compuserve.com/homepages/r_harvey/doc_dos.htm#Lbl19

I betcha never knew that dos had devices as files! Too bad they did such a limited and crappy, undocumented job...
The con file is DOS's half-assed implementation of a device file. It is supposed to be like /dev/console in Unix etc..

There are other device files too, for example you can print by typing "copy con > lpt1", then typing in whatever you want to print. End with CTRL-Z.

For more info see DOS Devices and C:\CON\CON.

Log in or register to write something here or to contact authors.