Question:
why cant v create a folder named "con" any were in the computer??
ahamed.nishadh
2006-12-14 01:01:45 UTC
An Indian discovered that nobody can

create a FOLDER anywhere on the computer which can be named as

"CON"

This is something pretty cool...and unbelievable. .. At Microsoft the

whole Team, including Bill Gates, couldn't answer why this happened!

So, inform about this to all your friends. TRY IT NOW , IT WILL NOT

CREATE " CON " FOLDER

Try To rename the New Folder as CON Or con It will not Accept ...
Seven answers:
Vesselin Bontchev
2006-12-15 00:55:40 UTC
Nonsense.



First of all, CON is not the only such "special" name. The other such names are AUX, PRN, NUL, LPTx and COMx, where "x" is a digit.



Second, Microsoft and Bill Gates know all about it, because they made it so long time ago, in the days of MS-DOS.



Third, the reason why you can't create such a file or folder is because it already exists! In particular, CON is the system console (the screen), PRN is the default printer, LPTn is printer #n, AUX is the default serial communication port, COMn is serial communication port #n, and NUL is the "null device", equivalent to /dev/null in Unix.



For instance, open a command prompt and enter



copy somefile.txt con



where somefile.txt is a text file - and the contents of that file will be sent to the screen. Enter



copy somefile.txt prn



and it will be sent to the printer, if you have one attached to your computer.



Fourth, you *can* create such a folder, if you're using an NT-like OS (WinNT, Win2K, WinXP) and if you *really* want to. For instance, let's suppose that you want to create a folder named CON in the folder C:\My\Folder. Open a command prompt and enter the following:



mkdir \\?\C:\My\Folder\CON



Voila, the folder CON is created there. But you can't enter that folder, can't put anything in it and can't delete or rename it from the Windows Explorer. The only way to delete it is similar to the way you have created it. Open a command prompt and enter



rmdir \\?\C:\My\Folder\CON
?
2016-05-24 04:43:55 UTC
ha... good Q.... this was a trick we used to ask in school time, Here you go .. It's not that weird. 'con' is a reserved word from the old DOS days, simply meaning 'console'. If you wanted to create a new text file in DOS you could type 'copy con newfile.txt' meaning copy from the console to newfile.txt. This would let you type some lines and when you ended the file with ^Z (DOSish for 'end of file') you would have a file called newfile.txt containing whatever you wrote in the console. This is indeed still possible in the Windows XP console, and can you see what mess it would cause if you let files or folders have the name 'con'? What would 'copy con newfile.txt' then mean? BSOD? Giving this list of other DOS devices that can't be used as folder names: CON, PRN, AUX, CLOCK$, NUL, COM1, COM2, COM3, COM4, COM5, COM6, COM7, COM8, COM9, LPT1, LPT2, LPT3, LPT4, LPT5, LPT6, LPT7, LPT8, and LPT9. Hope you get it.
Michael Darnell
2006-12-14 01:39:54 UTC
This is not a big mystery - just history and legacy compatibility. Back when dos was popular and memory was expensive, there were physical devices with three letter acronyms like PRN for printer and CON for console (display) - Since these are devices like the hard drive or the keyboard - they were reserved and the command processor parses them out and emits an error so people won't use them by accident. Ever since MSDOS you cannot name a folder one of these reserved names.



The console device is the default output - usually it just writes to the command line, or to an output file.



PS: Your claim that Microsoft doesn't know about this is incorrect, it is well documented in the MSDN libraries, and any programmer could tell you this stuff.
anonymous
2006-12-14 01:15:22 UTC
Con and a few other extensions are reserved for system files only and it has been that way for years.



Bill Gates knows all about it!
ch_nagarajind
2006-12-14 03:00:41 UTC
all the answers are wrong because con is reserve word in windows as in the dos we are having a command called copy con which creates a file so it that way it is a reserve word so that's what the reason it dosenot allow to create file
Selva Prasad
2006-12-14 01:22:27 UTC
The terms CON, PRN, LPT1, LPT2, NUL are reserved words right from the days of MS-DOS and still are, which only means these have a predefined meaning.



Which is why one cannot create any files in these names.
Roubini
2006-12-14 01:05:40 UTC
Unbelievable! I've just tried it! I had no idea about it! I really want to know why this can't happen!


This content was originally posted on Y! Answers, a Q&A website that shut down in 2021.
Loading...