Have you ever tried to create a folder named CON, PRN, NUL, COM1, COM2, COM3, LPT1, LPT2, LPT3 etc. in any of the Windows operating system? It should not be possible directly. The result will be the same, even if you try from the Windows explorer or the DOS command prompt.
Why is it not possible? These are reserved words in DOS. For example; CON represents the console and PRN represents the printer. (For example, in the command for creating files: COPY CON , what happens is; whatever you type in console is stored in the specified file. Similarly, TYPE filename > PRN is the command for redirecting the output to a printer, instead of screen).
In Windows, all devices are stored as files, like in the *NX family systems. In Linux, Unix etc. we can see the file location. But in Windows we cant. Its a system device file and so, we can't use the same name again. Windows has a policy which prevents the user from manipulating these entries. Each time the system is booted, these files and all the information about these devices and ports are loaded to the memory. You can see the details by executing the following command at the DOS prompt (Start -> Run -> Cmd)
MEM /D ¦ MORE
The ¦ symbol (pipe) is used to prevent the output from scrolling. The command gives a clear idea about the items loaded. You can see CON, PRN, COM1 etc. loaded as device drivers. This is the reason why we are not able to use these names as filenames.
But then, is it really possible to name files using these keywords? The answer is yes. There are two different methods for doing it. One is a silly method and the other one is a standard method. The silly method is just a trick. Right click to create a new folder and while naming it, type 'CON' and then 255 in numpad holding the ALT button. ie. 'CON' + (hold ALT + 255). You need to make sure that the number lock is ON. This creates a folder with name CON and a space in the end. (ALT + 255 is blank character. You can use this to generate any valid ASCII character. For example, to get'A', type ALT + 65. For 'a', type ALT + 97. Remember; digits in the number pad must be used, with number lock on). Use any reserved word instead of 'CON' to create the required folder. But, as I said, it is just a simple trick because you are creating a folder with an extra character at the end of filename, and NOT using the reserved word as such.
The second method is a standard one. In this case, we will use a syntax that bypasses the normal reserved-word checks altogether. For this, we need to specify the absolute path with the \\.\ characters. For example, to create the folder CON in the E: drive, use the following command.
MD \\.\E:\CON
Similarly, to remove the same folder, you can use RD \\.\E:\CON. Like I mentioned, you need to specify the full path with these commands. Once created, these folders/files cannot be deleted or renamed using the Windows explorer. You need to use the RD or DEL commands for this purpose.