Super User is a question and answer site for computer enthusiasts and power users. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

in all versions of Windows we are unable to rename a file or a folder name as con unless we use a renaming software. Why a file or a folder can't be renamed as con?

share|improve this question

"con" is the name of a system I/O device, the console.

  • con
  • err
  • nul

And a couple others, I think.

In the old days it was common in DOS to create a file (and I still do this occasionally) with:

C:\>copy con foo.txt
I'm typing some text here.
    1 file(s) copied.
share|improve this answer
A minor correction: err is not reserved. The full list of reserved device names is: con, nul, prn, com1..9, and lpt1..9. They are even reserved when used with any extension (e.g. con.txt). – efotinis Dec 23 '09 at 19:52
"unless we use a renaming software" About the quoted part, how do the "renaming software" get around what is essentially an OS limitatiom – Sathya Dec 23 '09 at 19:57
You got me. I'm sceptical that any "renaming software" can even do it. But if it can, I'd be worried about being able to open or even move the file. As you said, the OS is going to take issue with it. – JMD Dec 23 '09 at 20:32
The master list is at 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. – shf301 Dec 24 '09 at 17:07
@Sathya: By using the \\?\ prefix to bypass file name parsing. For example, " \\?\C:\con\nul.txt ". – grawity Aug 26 '11 at 17:29

CON is a reserved name in Windows. So are PRN, AUX, NUL, LPT1 and others.

share|improve this answer
CON is short for console. Open a command prompt window, navigate to a directory with a text file and type "copy file.txt con" It will write the contents of the text file to the console (the command prompt window) – Keltari Sep 12 '12 at 18:45

i gave this answer to a duplicate, and thought i'd post it here for your reference:

as previously stated. it's a reserved word from back in MS-DOS, for the CONsole device (as far as i can remember). but, you can force windows/dos to create the folder for you. for devices, it uses the format \\.\[RESERVED_WORD] to access the "file" (these devices used files for communication). to force windows to create your folder, instead of doing mkdir [RESERVED_WORD], do the following:

mkdir \\.\[absolute path to folder of choice, including drive letter]\[RESERVED_WORD]

for example, to create CON folder on my desktop,

mkdir \\.\C:\Users\me\Desktop\CON

to delete the folder, you have to reference it the same way, or else it won't work.

rmdir \\.\C:\Users\me\Desktop\CON

my advice though is to just use a different name. it would be very difficult to always refer to it via its absolute path, especially if you are developing an app you plan on deploying.

share|improve this answer

This is because it is used to represent the "internal devices". However, you can create this folder using the following command in a command prompt:

C:\>md \\.\e:\con

This folder can't be deleted via right click, delete. You have to use the following command (again in a command prompt):

C:\>rd \\.\e:\con


share|improve this answer

You can rename it without using any special software, just the command prompt:

For example:

C:\>echo Test > \\?\C:\con
C:\>type \\?\C:\con
C:\>rename \\?\C:\con test.txt
C:\>type test.txt

After \\?\ the full path should be specified.

share|improve this answer

Just like there are characters that cannot be used in a filename, there are also several words (whole filenames) that cannot be used because they are reserved.

share|improve this answer

copy con is an archaic (MS-DOS) method of creating a text file. For example:

copy con output.txt

So it is a reserved word and cannot be used as a folder name in Windows.

share|improve this answer

As mentioned, you can create and manipulate files and folders with reserved names on the command line by using a device or filename namespace such as \\.\C:\NUL, but look at what happens when you try to access such a file or folder through Windows Explorer:

Error opening folder named NUL Error deleting folder named NUL

Any access to an object with a reserved device name is treated as referring to the device specified by that name, unless you use the aforementioned namespace workaround. These errors occur because Windows is attempting to operate on them as if they were normal folders, but you can't open a device named NUL, CON, or otherwise as a folder—hence the Incorrect function error (which is similar to the Inappropriate ioctl for device error on Linux).

share|improve this answer
You’ve mixed up the terminology a bit. \\.\… is a Win32 device namespace, \\?\… is a Win32 filename (also for folders) namespace, and \\compname\… is a UNC (network) path. – Synetech Sep 26 '12 at 5:02
@Synetech: Corrected. – bwDraco Sep 26 '12 at 13:14

In addition to Pablo Santa Cruz's answer here comes the full list of protected keywords in MS-DOS:


these keywords are used by Windows internally and are reserved Keywords. CON is used for CONSOLE, PRN for PRINTER, LPT’s for PARALLEL PORTS...

You can use _con instead

share|improve this answer

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .