Subscribe:Posts Comments

You Are Here: Home » Windows » 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…


23 Comments

  1. sakthivel says:

    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 says:

    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. Soroosh says:

    Thanks a lot for useful article :)

  4. Ankur says:

    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 says:

    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. 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. SUMIT VYAS says:

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

  8. SUMIT VYAS says:

    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. vamsi says:

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

  10. Ibrahim says:

    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 says:

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

  12. Himanshu Lenka says:

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

  13. Omera says:

    thx alot ..

  14. Mr. Medhat - Kuwait says:

    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 says:

    yes I got my ans.

  16. arthy says:

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

  17. dnand says:

    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.. Ü

  18. PriyaThandavam says:

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

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

  20. sundar.v says:

    Type con & press ALT+255

  21. Rajkumar sahu says:

    sir really article very useful.
    i am created this folder is successfully
    thanks!

  22. haziq says:

    This is because it is for the standard output device CONSOLE.
    There are other names like ‘prn’ and ‘aux’ will also not work the same since they are respectively for PRINTER and AUXILLARY devices.

  23. deepak says:

    hello sir!your article is superb really.please share some more facts like this.

Leave a Reply

© 2008 Opensupportindia · Subscribe:PostsComments · ·