Unable to rename a folder or a file as 'con'
In linux it works, but not it Windows, I tried a lot and It just returns to "New Folder", why?
Super User is a question and answer site for computer enthusiasts and power users. It only takes a minute to sign up.Sign up to join this community
It is a reserved keyword:
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. Also avoid these names followed immediately by an extension; for example, NUL.txt is not recommended. For more information, see Namespaces.
Raymond Chen also writes about these reserved names in his blog post What's the deal with those reserved filenames like NUL and CON?.
Long story short, they existed back in DOS 1.0 and are still around for compatibility reasons (no joke):
But why do we carry these magic filenames forward even today?
Because everybody still relies on them. Just look at all the batch files that do things like redirect to >NUL or test if a directory exists by asking "if exist directoryname\nul", or all the documentation that says to create a file with "copy CON ...".
You can't name folders/files
COM[1-9] (there is more) because these are reserved as they are system communication ports.
A full list of reserved file/folder names can be found here.