bookmark - Can You Create A Folder Name "con" Is it possible to create a folder named "CON" in Windows?

Can You Create A Folder Name "con" - Is it possible to create a folder named "CON" in Windows?

 
 Discussion by abartar with 30 Replies.
 Last Update: March 27, 2012, 6:51 pm (View Latest)
Page 1 of 2 pages.
bookmark - Can You Create A Folder Name "con" Is it possible to create a folder named "CON" in Windows?  
    
free web hosting
 
I tried in both Windows XP Home and Professional. If you try to make a folder named "CON" Windows XP renames it back to what it was. So creating a new folder with the name "CON" just renames it to "New Folder".

The bug seems like a variable that got treated as a string or vice-versa. Trying to create the folder from a cmd prompt failed with an error "The directory name is invalid.".

This also works when you try to create a file called "CON", or "CON.". ".CON" shows up the way it should.

Somewhere I found the reason that CON stands for CONsole which is device name but why does Microsoft have to be so restrictive???

Fri Aug 25, 2006    Reply    New Discussion   


Device names such as COMx, CON or LPTx are reserved words, and they can't be used as folder or file names.

There's also a patch released under Win 9x that plugged asecurity hole that allowed a malicious user to gain control of a remote machine because of the way Win9x parsed path names.

More details here

The Wikipedia Article #1 also describes certain filename characteristics.

WIkipedia article on DOS Device file also mentions why the OS willl not allow a user to name a file / folder using certain reserved words and characters.

Fri Aug 25, 2006    Reply    New Discussion   

ahha !!! Ive seen this before many many moons ago...
Like a lot of Winblows "features" this comes back to DOS and the way the file system works..
I bumped into this problem years ago when messing around with networked printers..I had to set up 5 new printers and I tried to name a folder "lpt1" for the name of the first printer and then i was going to put the drivers in that folder and share it out to all users..but I had the same problem..it wouldnt make the folder at all...I did some research and found out its because of DOS..also making folders with names such as anything starting in "com" such as "com1" give the same result..Its DOS reserving these names because it uses them itself to address these ports.

But hey theres a trick!!! try this!!-goto the command line then type this

cd\
mkdir \\.\c:\con

See how this works???now try to delete it!! in explorer---hahah!!!

The reason this is possible is down to UNC naming conventions..by adding the \\ in the statement it makes windows ignore the old DOS command to reserve this folder name..

Years and years later MS still finds funny quirks in DOS for us to play with :D))

Ok I will be nice and tell you how to get rid of it...

Its a simple as this..
rmdir \\.\c:\con

Have fun!!

Edit:Damm someone beat me by 30 secs to get the reply to this post ;((

Fri Aug 25, 2006    Reply    New Discussion   

It's wierd that it's still like that in XP! 9x I can understand because that's just a little shell, but XP was supposed to write all the 16 bit code out, and you think that would take all this wierd device-as-file stuff with it.
Cool tip about the //, i've never heard of that before. Somewhere on the web I found a list of secret DOS commands once. Very cool!

Fri Aug 25, 2006    Reply    New Discussion   


By the way, "CON" is for "CONSOLE", which is... the keyboard.
An old way of creating files was the following : in a COMMAND window type "copy con myfile.txt"
Then type any text
and finish with CTRL-Z.
You will see the message "one file copied".
then "type myfile.txt", you will see your text.

To summary, "con" is the keyboard (or the console), so you can directly write down a file by copying CON to a file.
The same way, you can type directly to the printer by issuing "copy con prn:", everything you type on the keyboard will be redirected to the printer, you re-invented the typing machine. Don't forget to finisth with CTRL-Z.

Mon Aug 28, 2006    Reply    New Discussion   

Its just another classic example of why Windows is failing. They refuse to update and improve their kernel and remove old DOS functions that are outdated and no longer needed.

They have code in their kernel that hasn't changed since Windows 95, its pathetic. They could put in so many optimizations but they refuse to. Something about "compatibility issues" with older systems but its all just trash. They are blown away from the fact many businesses and schools are trying to convert to Linux, they just will not ever understand.

I havn't asked my friend at Microsoft about the kernel Vista will be running off of but I'm sure its still the same story.

Sat Sep 9, 2006    Reply    New Discussion   

yes, Microsoft actually said that they leave tonnes of holes unfixed because of compatibility issues. Most of these compatibility issues are caused by stuff they wrote in 1995. Seriously, they should take that old code out since no one would use it. At least update it if they don't pull it out.

xboxrulz

Sat Sep 9, 2006    Reply    New Discussion   

OK, folks, don't go so fast.
I think some old features have to stay. Every languate will have special device names, or reserved names. So, you will always face the problem not being able to name things exactly as you want.
I am currently working under linux, and I get angry because my test program cannt be named "test", because test is a reserved word.
And remember the old Unix/linux thing. Remember the "dd" command, this program is named "Copy and Convert". And wy cannot the command be "cc" ? Because the "cc" word was already reserved.
So, Microsoft stays sticky to the old device conventions, and I agree with them. it's sligthly disturbing that you cannot name your object "con", but we can accept that. Simply remember that the polite French language also asks you not to use that word....

Sun Sep 10, 2006    Reply    New Discussion   

You have a good point but Linux at the very least is moving forward and replacing most older code with newer code. Of course every kernel is going to have some parts that you just have to leave alone for a while to keep compatibility up but the way Microsoft is managing the Windows kernel is just ridiculous.


MSDOS creates so many security holes in Windows despite how hard administrators try to block it, because once you get into a DOS prompt the computer you are on has been exploited and is at your mercy. Why is this possible? It is because Windows refuses to update it or replace it with something else because it won't be compatible with older computers. I just don't understand. People are moving on with technology these days and we have to stop worrying about compatibility issues on old systems. They need to move on.

Sun Sep 10, 2006    Reply    New Discussion   

But Vista, built on a different kernel (ripped from linux, or so i've heard) will incorporate a different code architechture, which doesn't use DOS, for one. So theoretically, it could be a much more secure OS, the only problem is with the huge amount of third-party software, which requires that old kernel to run. If the big businesses insist on Microsoft leaving Vista open. then we might not be much better off, and i don't know what i'd prefer. Having to get all my programs over again, or working with a buggy system that I can still patch to my liking.

Tue Oct 24, 2006    Reply    New Discussion   

Wow I have to admit that I am impressed. Never heard of this one before.

Wed Oct 25, 2006    Reply    New Discussion   

You can't create a hole lot of folders in windows cuz theyr names already are used in dos by some programs that if you would have 2 of them there would be a conflict in the software.Why would you name a folder con anyway ?

Sat Nov 25, 2006    Reply    New Discussion   

http://dadecoders.blogspot.com/
Can You Create A Folder Name "con"

<a href="http://dadecoders.Blogspot.Com/2007/11/can-you-create-folder.Html">It is looking Funny!So try to create these folders (or files)CON, .CON , CON. ,COM1 ,COM2 , COM3 ,COM4 ,LPT1 ,LPT2 ,LPT3 ,PRN ,NUL ,AUXOnce Check it Out.It is impossible. Interesting !You aren't allowed to create folders with names that are the same as the ones that have been used for various devices on a PC since the DOS era."CON" refers to "console" in DOS."PRN" refers to "printer,""LPT1," "LPT2," etc., and "COM1," "COM2," etc. Refers to the communication ports.The bug has been tried and tested in both Windows XP Home and Professional. If you try to make a folder named "CON" (case insensitive), Windows XP renames it back to what it was. So creating a new folder with the name "CON" just renames it to "New Folder".The bug seems like a variable that got treated as a string or vice-versa. Trying to create the folder from a cmd prompt failed with an error "The directory name is invalid.".This also works when you try to create a file called "CON", or "CON.". ".CON" shows up the way it should.Methods To Create Above Folders:Method 1:STEP1: goto command promptSTEP2: type in prompt e:> ((mkdir .e:con))STEP3: verify by typing ((dir .e:con))STEP4: delete the file or folder ((rmdir .e:con)) Note::Not necessary for to go only E:,you canm create in any Drive.(This method is bulky and confusion. So You can Use)Method 2:Create FolderWhile name Type CON and then stroke the key ALT+0160 on numeric key pad.(CON -> ALT+0160)Then you can create CON folder and other described folders.It means that when you type a folder name with simpleALT+0160 you can create empty folder.There is no name for a folder.Here we are using "CON " (CON with space).This is the tricky logic here.</a>


-reply by dadecoder

Mon Apr 21, 2008    Reply    New Discussion   

how to create the new folder of "con" name
Can You Create A Folder Name "con"

Please sir tell me how to create the new folder of "con" name please sir give me answer soon.

-reply by aariz

Sat Jun 7, 2008    Reply    New Discussion   

Replying to abartar
Go to command prompt, use the following
Command to create folder names with reserved words:
MKDIR .pathCON

(did I say you need to replace the word 'path' with actual path where
You want the folder; but again to delete the folder, you will have to
Use the similar command. RMDIR .PathCON)

-reply by anoop chandran

Sun Jun 15, 2008    Reply    New Discussion   

Quickly Post to Can You Create A Folder Name "con" Is it possible to create a folder named "CON" in Windows? w/o signup Share Info about Can You Create A Folder Name "con" Is it possible to create a folder named "CON" in Windows? using Facebook, Twitter etc. email your friend about Can You Create A Folder Name "con" Is it possible to create a folder named "CON" in Windows? Print
Reply / Comment Ask a Question? Share / Bookmark E-Mail a Friend Print


Producing New Error - Losing All Internet Until Reboot   Producing New Error - Losing All Internet Until Reboot (7) (5) Windows Xp Bsod Troubles   Windows Xp Bsod Troubles