Wednesday, December 23, 2009

How Can I Create Folder On Windows Named CON, PRN, AUX, NUL, COM1, COM2, COM3, COM4, COM5, COM6, COM7, COM8, COM9, LPT1, LPT2, LPT3, etc...??

Ok first of all this is one of the coolest prank you can play on your friends if they do not know anything about Windows Operating System !
Walk up to any of your friend and ask them to create a folder named CON or in fact you cannot create a folder named any of these keywords : CON, PRN, AUX, NUL, COM1, COM2, COM3, COM4, COM5, COM6, COM7, COM8, COM9, LPT1, LPT2, LPT3, LPT4, LPT5, LPT6, LPT7, LPT8, and LPT9.
They simply won’t be able to, because Windows will not let you create a folder of any of the keywords mentioned above for a simple reason that these keywords are used by Windows internally and are reserved Keywords. CON was used for CONSOLE, PRN for PRINTER, AUX for AUXILIARY DEVICE, LPT’s for PARALLEL PORTS and such. Microsoft has taken this initiative to avoid any conflict that may arise as a result of using these keywords.
Now if you are wondering whether if you can create a folder named CON, AUX or any other reserved keyword, the answer is YES. There is an evil way to achieve this, but its definitely not advised, as this can create ambiguity. Try this at your own risk.
Here’s how you can achieve this.
1> Open the command prompt on your system by clicking on Start –> Run and then type cmd
2> When the command prompt opens, type md \\.\\”\CON”
Get the full path to your desktop and put it in between the double quotes where you have .
3> Hit Enter.
That’s it, now you’ll have a folder named CON on your desktop, now follow the same for all the other keywords !
You are done with creating the folder, now what ? Well you need to delete the folder you created. But try deleting it, you won’t be able to!! Surprised ? Well you had to be, but don’t worry, there is an easy way to delete this folder. To remove the folder you created, follow the steps:
1> Open the command prompt on your system by clicking on Start –> Run and then type cmd
2> When the command prompt opens, type rd \\.\\”\CON”
Get the full path to your desktop and put it in between the double quotes where you have .
3> Hit Enter.

How can we create folders with such restricted names ??
Some people advice you to create con named folder by fooling yourself :P by typing c then 0(zero) then n.. But lets get real ways..
Open the Command prompt by Start -> Run and typing cmd
Type:
C:\> md \\.\c:\con
then hit enter.
Replace the word con with any of the above-mentioned restricted/blocked folder names if you desire.
Now, Open My Computer and browse through the path where you created CON folder.(Drive C: in our case here). Hurray!!! we created it successfully. Now the next time, one can’t challenge us for this. Now try to delete the created folder. It won’t delete. Now try this in command prompt console (start - run - cmd)
Code:
C:\> rd \\.\c:\con
Its removed now…

No comments:

Explaining DNS Concepts - DNS Servers-DNS Queries-DNS Records

3 types of DNS queries— recursive, iterative, and non-recursive 3 types of DNS servers— DNS Resolver, DNS Root Server and Authoritative Name...