views:

1055

answers:

6

Why in Windows, can't you name a folder 'con'?

Whenever I try to name a folder as "con" (without the quotes) it defaults to its original name.

Why does it do this?

A: 

http://support.microsoft.com/kb/74496/en-us

Other reserved names: PRN AUX NUL LPT1 COM1

Jordan Liggitt
+2  A: 

This dates back to MS-DOS. Reading or writing to a file named "CON:" read/wrote from the console. I imagine Windows is still supporting this for backwards compatibility.

MattK
A: 

From Microsoft TechNet:

Several special file names are reserved by the system and cannot be used for files or folders:

CON, AUX, COM1, COM2, COM3, COM4, LPT1, LPT2, LPT3, PRN, NUL

Michael Itzoe
Your link brings me to a "Windows XP" page without your quote.
strager
+14  A: 

Do not use the following reserved device names for the name of a file:

CON, PRN, AUX, NUL, COM1, COM2, COM3, COM4, COM5, COM6, COM7, COM8, COM9, LPT1, LPT2, LPT3, LPT4, LPT5, LPT6, LPT7, LPT8, and LPT9

Source: MSDN

Other names, such as drive names, cannot be used as well:

CLOCK$, A:-Z:

Source: Microsoft support

strager
+17  A: 

Back in the dos days, "con" had a special meaning. It referred to the console, and allowed you to treat it like any other file. For example, you you might create a new text file by typing copy con new.txt. Then you could enter your text and hit ^Z when finished.

The thing is, you can still do that. Therefore, as far as the file system is concerned there is already an object out there named con. There are other reserved names as well, but I see that while typing this those names have been provided already in other answers.

Joel Coehoorn
Ah; I had not known that. Pretty cool. =]
strager
+ 1 for answering the implied question as to "why" CON is reserved.
Charles Bretana
Whatever the reason might be, microsoft should have hidden this from the user. can you imagine an old couple (who doesn't have a clue about DOS and the old times of computing) getting frustrated trying to rename their grandchildren's photo album to CON (or the other reserved ones) ??
Emin
@Emin, Well, you can't name a folder "friends/family" either, but at least that gives you an error message. I think renaming to "con" (and others) shouldn't be silently ignored.
strager
@strager you ment absolutely what I thought. I just cannot imagine my father trying to do that without an error message. He would probably come to me the next day saying the computer is broken :)
Emin
Updated to add a link to reserved names.
Joel Coehoorn
+3  A: 

Actually you can rename the folder to "con"

use this in the command prompt and this creates a system folder named "con" on your "C Drive"

md \\.\\C:\con

to remove this folder you need to use this in the command prompt

rd/s \\.\\C:\con

And just for those that are wondering "so why would you?" - my name is CON and if I wish to use that as my folder I WILL so "bugger you MS"

Con "OzDing"