Creating a folder named Prn

Posted: January 24, 2007 in Computers and Internet
Do you know that you cannot create a folder named Prn in Microsoft Windows operating systems?
It is true that you cannot create folder as such visually (Using Windows Explorer). Instead you can create the folder by using command prompt.
Just open the command prompt and type
mkdir \\.\C:\prn to create a folder named con in the C drive.
If you need to remove the created folder, type
So if you only needed to create a folder named prn this is it, but if you would like to know further read on.
This restriction is because printer is referred by prn in device level (Printer is considered as a virtual folder.). So if you are permitted to create a folder named prn Windows will get confused when it is told to print a document since there are two folders/devices.
What we do here is we are making the directory a network associated folder by using ‘\\.\‘.
Prn is not the only word which is blocked by Windows. Following words are also blocked because they are also representing some device in device level as I have mentioned below.
Word                      –   Represented Device
prn                         –   Printer
con                         –   Console
lpt1 to lpt9               –   Parallel Port Interfaces on IBM PCs (Named because at that time this port is heavily used by Line Printers)
com1 to com9          –   Communication Ports
aux                         –   Serial Ports
nul                          –   Null (Not 100% sure)
If you need to create folders with the above names you have to create them as network associated folders.

Leave a Reply

Fill in your details below or click an icon to log in: Logo

You are commenting using your account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s