Reserved filename in Windows

Dmitry June 5th, 2007

I just found out, you can’t create a file/directory named “con” on windows. I thought I was going crazy for a second there.

Just try it! It won’t work. Does anyone know why though?

6 Responses to “Reserved filename in Windows”

  1. Daniel Burkeon 14 Jun 2007 at 1:15 am

    Sorry I should elaborate upon that, the idea was that if you were in a really dire situation in dos you could cobble the system together with something like…
    C:\>copy con autoexec.bat
    @echo off
    prompt $p$g
    lh mouse
    (then press [f6] or [ctrl]+[z] to generate the “Z^”, and press [enter])

    And it would create a text file. So as long as you still had command.com, you could always print, create and read text files. Saved my hide more than once.
    Also you could type “copy con prn” to turn your computer into an overpriced typewriter :-p

  2. Dmitryon 15 Nov 2007 at 4:32 am

    Thanks!

  3. Paramjiton 28 Jan 2008 at 2:48 pm

    con is reserved for console which means your keyboard and monitor.
    try:
    C:\> copy filename con:
    this will display the contents of the file.

  4. Michael Hendrickxon 17 Feb 2008 at 3:12 pm

    There are a few reserved keywords. con, prn, aux. It’s what caused the con/con DoS back in the 90’s :)

  5. afdzal3on 22 Feb 2008 at 1:06 am

    The other keyword that you can’t create the folder with are: -

    PRN- refers printer
    NIL - refers void
    AUX - refers to the auxilary device
    COM1 - COM 1 port
    COM2 - COM 2 port
    COM3 - COM 3 port
    COM4 - COM 4 port
    LPT1 - LPT 1 port
    LPT2 - LPT 2 port
    LPT3 - LPT 3 port
    etc …

  6. Dmitryon 22 Feb 2008 at 1:39 am

    awesome! thanks guys

Trackback URI | Comments RSS

Leave a Reply