Saturday, July 06, 2013

How to create a Folder With Any Name e.g con,prn.etc

The creation and renaming of folder is known to mostly users But Today I shall inform you an interesting thing about folders that "folder cannot be created with some specific names i-e con,prn..... etc".This process will show you the way to create folders with such names.So let,s Know it.



Process to Create a New Folder and Rename it:
E.g. a) right mouse click- > new- > new folder
      A folder will be created with name “new folder”.
We can also change its name (right mouse click- >rename- >give a new name to the folder Suppose “xxx” or simply press F2 and give a new name) Now the name of the folder changes from “new folder” to “xxx”

b) We can also create a folder by command prompt
For this open command prompt (  + R- > type “cmd”- > hit enter )
E.g. It will display the command prompt screen-
           C :\
Use “mkdir” command to create a folder.
C:\>mkdir [path where to create the folder]\folder name then hit enter
E.g. suppose you want to create the folder having name “xxx” inside the folder “zzz” in d: drive.
Then type     
C:\>mkdir d:\zzz\xxx
c) We can also change the folder name by command prompt.
For this open command prompt ( + R- > type “cmd”- > hit enter)
E.g. It will display the command prompt screen-
          C :\>
Use “rename” command to change the name of the folder
C:\>rename [path of the folder whose name to be change] [new name of the folder]
E.g. suppose you have to change the name of the folder “xxx” to “rock” which is present inside the folder
“zzz” in d: drive. Then type
C:\>rename d:\zzz\xxx rock

But, there are some exception, we can’t create a folder with those name in the above two process
Some of those names are:-
Con
Prn
Nul
Lpt1
Lpt2
Lpt3
Lpt4
Lpt5
Lpt6
Lpt7
Lpt8
Lpt9
Com1
Com2
Com3
Com4
Com5
Com6
Com7
Com8
Com9

If we try to create folder with those names it will not created or if we try to rename any other folder to those name it will Not be change. This will display a message “the specified device name is invalid” or “the directory name is invalid”.We can also create those folders by command prompt. Only we have to make some correction on the path of the folder where We have to create the folder.

Steps for creating the folder with those exception name :
Step1:-
                For this open command prompt ( + R- > type “cmd”- > hit enter)
E.g.              It will display the command prompt screen-
                       C :\>
Step2:-
              Type mkdir\\.\[path where to create the folder]\[folder name] then hit enter
   e.g. Suppose we have to create a folder with name “con” inside the folder “zzz” in d: drive. Then type     

C:\>mkdir\\.\d:\zzz\con
Then a folder with name “con” will be created inside the folder “zzz” in d: drive.
We can use any other name instead of “con” to create a folder with that name & also change the path of the folder.

NOTE:-
 In general process these folders are also not deleted.
To delete this folder use “rd” command.

e.g.  To delete previously created con folder type
     C:\>rd\\.\d:\zzz\con

Like the Post? Please share it with your Friends.

No comments:

Post a Comment

Warning !

Search This Blog