Wednesday 15 June 2011

How to Create a CON folder in Windows?



Can you create a folder named “con”, “prn”, “nul”, “com1″, “com2″, “lpt1″ etc. in windows ?


The answer is NO and YES!


   


NO because when create a new folder and try to rename it to any one of the above specified names, you know what happens! In Windows XP the folder name automatically changes back to “New Folder” no matter you try any number of times. Where as in Windows Vista/7 when you try to rename the file you get an error message “The specified device name is invalid”.


What is the reason for this? 
Simple, these names represent the internal devices and hence we cannot create folders with the above names.
YES because it is still possible to create these folders using the command prompt. Here’s the instructions to create it.

1. Go to command prompt (Start --> Run --> Type cmd --> Click OK)
2. Type in prompt (FOR EG. TO CREATE CON FOLDER IN E: DRIVE)
C:\Documents and Settings\Parag>
C:\Documents and Settings\Parag>E:
E:\>
E:\>md\\.\e:\con
Folder is Created.....!!

For deleting this folder, type...
E:\>rd\\.\e:\con
Folder is Deleted.....!!

NOTE: "con" can be replaced by any other names such as "prn", "null", "com1", "com2", "ipt1" etc..
NOTE: The folder can only be deleted from the command prompt. You cannot remove it by right-click delete.


Thanks,
Parag

No comments:

Post a Comment