Home > Windows > Why can’t we create a folder by name CON?

Why can’t we create a folder by name CON?

I’ve been asked this question many a times: Why can’t we create a folder by name CON? Although it seems a wonder or magic that we can’t create a folder by that name, in reality, it is not so. It has a definite reason, and in fact, a folder can be created using that reserved name.

Gone are the days when computers had only CUI OS, that is, Character User Interface Operating Systems, like MS-DOS. When I joined my first computer course nine years ago, Windows 95 was ruling. You could see Windows 98 here and there. We were in 8th standard, and working on a computer was like a dream coming true. Microsoft’s Paint Brush was the only known (for us) GUI software and was the greatest means of entertainment. The instructors taught us only MS-DOS commands and how to Shut Down the computer. Remembering such weird names as DIR, CD, MD, RD, CHKDSK, FDISK, VER, ATTRIB, REN, DEL etc. along with their syntax and usage was a great accomplishment. But I had a problem understanding this: DOS has a separate dedicated command for every action; literally every action, except… creating a file!

Yes, we used COPY CON filename to create a file with name filename. Anyone can say that it is a form of COPY command. So, why was creating a file different than all other commands? I didn’t understand it, till I found out how to print using DOS, almost four years later.

DOS uses different names for the attached devices, I learnt. PRN was one such name. TYPE filename would display the contents of a file and TYPE filename > PRN would print it instead of displaying. Curiosity brings many hidden matters out. PRN would surely mean Printer and will redirect the output to the printer instead of console. Console (monitor) is the implicit default output device, and it can be bypassed if needed. So, how to put it explicitly? There must be some means to do that. Yes, there is! TYPE filename > CON performs exactly same function as TYPE filename. These special names for the devices really mean something special for the operating system and those names can not be used as folder or file names: CON, PRN, NUL, COM1 to COM9, LPT1 to LPT9, which stand for CONsole, PRiNter, NULl, serial COMmmunication ports, Line PrinTer ports.

The time has changed and Operating System can also be fooled! But still, many people think that it is not possible to create a folder by name CON. Using the path of network drive, these special names can also be used as folder names! Here is how:

  1. Goto DOS
  2. Type MD \\.\C:\CON. The folder will be created. You can check it in Windows Explorer also, but you can’t access it
  3. To delete the folder, type RD \\.\C:\CON

In short, use the network path syntax instead of absolute path syntax.

Now on to the practical aspect of this. Why can’t we create it directly but using the network path syntax? The answer is simple. A computer can have only one default console, printer, null etc. So, if it is accessed from a network, theoretically, the console should belong to another node in the network. Since that node may not have a device which can be referred using the name CON, it will no longer be considered as a reserved name. Hence, the folder can be created.

The next time when someone asks the question why we can’t create a folder by name CON, say with confidence that it is not true…

Categories: Windows
  1. sakthivel
    July 10, 2008 at 2:35 pm | #1

    Hi Raghu,

    According ur comments, today i have learnt main things(i.e way of (CON) folder creation).

    Note:one more request,please send me if you have any other tips like this.

    Thanks a lot…

    Regards,
    Sakthi.P

  2. Vijay Das
    July 19, 2008 at 10:49 am | #2

    Dear Sir/ Madam,

    this is vijay from delhi, sir i want create con folder on my computer,
    so, plz give me solution how can create con folder on my computer……

    plz sir some body is challege me……

    i am waiting your reply sir…..

    regards,

    Vijay Das

  3. July 25, 2008 at 8:03 pm | #4

    Thanks a lot for useful article :)

  4. Ankur
    July 30, 2008 at 5:39 am | #5

    hello sir!

    your trick of creating con folder is too good.
    kindly send me some more tricks like this.
    i m very thankuful to u.

  5. himanshu patel
    August 29, 2008 at 12:51 pm | #6

    Dear Sir/Madam
    This is himanshu(sunny) from banglore, dear i want to create CON folder in my computer
    so,please give me the solution if u can

    thank you SIR/MADAM

  6. September 16, 2008 at 12:25 pm | #7

    I found how to create a folder or file named CON , LPT1 , COM1 etc…

    STEP1: goto command prompt

    STEP2: type in prompt e:\> “mkdir \\.\e:\con”

    STEP3: verify by typing “dir \\.\e:\con”

    STEP4: delete the file or folder “rmdir \\.\e:\con”

  7. November 1, 2008 at 10:19 am | #8

    create New Folder Rename Type Con & Alt Press Hold Type 255 & Free Alt Key Enter Create Computer Con Folder

  8. November 1, 2008 at 10:27 am | #9

    You Create CON folder Simply Tricks.

    1 Open Any Zip File.
    2. Create New Folder This Zip File right click create new folder
    3. Enter
    4. Rename Folder Con
    5. you see create con folder

    This is Magic

    s78648007@yahoo.co.in

  9. November 27, 2008 at 4:26 pm | #10

    the making of ‘con’ procedure is superb…
    well done author

  10. Ibrahim
    December 6, 2008 at 12:04 pm | #11

    hello guys just the one tht said

    create New Folder Rename Type Con & Alt Press Hold Type 255 & Free Alt Key Enter Create Computer Con Folder

    did not work..or i did not do it properly can somone say it again and specify each step plz

  11. shiteme
    December 28, 2008 at 1:47 pm | #12

    dear sir/madam are you serious WTF????

  12. Himanshu Lenka
    January 8, 2009 at 8:52 am | #13

    Gr8,good to have such tricky questions and solutions.
    kindly post more of such.

  13. Omera
    January 8, 2009 at 4:45 pm | #14

    thx alot ..

  14. Mr. Medhat – Kuwait
    January 10, 2009 at 8:30 am | #15

    Well, all I can say is that “Why only CON?” There are always “PRN, NUL, COM1 to COM9, LPT1 to LPT9″
    Anyhow, am still on the way 2 try it. Hope I’ll do it properly one day. Thanx again 4 all.

  15. Dwarka yadav
    February 15, 2009 at 5:38 am | #16

    yes I got my ans.

  16. arthy
    March 20, 2009 at 1:27 pm | #17

    sir,
    i learnt a good thing here..
    please do send me some other tips like this,..

  17. dnand
    April 23, 2009 at 10:15 am | #18

    To Ibrahim – “Alt 255″ is the alternate way of typing “space”… check “Insert Symbols” in either MS Word or MS Excel… In other words, you still cannot create a file name with purely “CON” as a file name; What Sumit Vyas did was to add an extra space after the word “con” using the above “algotrithm”, which is why he was able to create the file name .. Ü

    raghupathy has the most plausible explanation… I also grew up during the times when we had to memorize control keys like “CTRL > OC” in WinWord to “center” the test I am typing, etc…. etc.. funny stuff which really made sense way back then.. with today’s modern OS, somehow these have become analogous to “fossils” – we marvel at them because we are no longer aware what they were originally intended for…

    Also, by sheer curiosity, try saving any MS Office file using “CON”, “NUL” etc as file names and you will get straighforward answers.. Ü

    • PriyaThandavam
      May 23, 2009 at 1:20 pm | #19

      Sir,
      Really ur article is very useful.Its wondering. Thanks.

    • May 23, 2009 at 1:21 pm | #20

      Sir,
      Ur article is really nice and wondering. Thanks. Great work.

  1. No trackbacks yet.