Search code examples
javawindowspackagedirectorysubdirectory

Why can't i create a folder named 'con' in Windows?


I was creating a java package. When I created a folder named 'con' i got this error. And then I tried to create it any other folders of my computer and I couldn't. It is a wonderful error. Does anybody know why this occurs?

Error Image


Solution

  • The reason is these keywords are reserved for some tasks to be performed by the OS. It uses these words to create folders from time to time and store data in them for tasks related to printing and other functions. We creating a folder with the same name would confuse the system.

    Still, we have the below hack to do it :p

    Once the new folder is created, right-click on it and select the option “Rename”. Hold down the ALT key and type 0160 from the numeric keypad (ALT+0160) and release the ALT key. Now, the folder name should go blank so that you can type any name of your choice such as “con” and press Enter.

    *Taken from https://www.gohacking.com/how-to-create-con-folder-in-windows/