June 26, 2009

How to create folders named con lpt1 com1 prn in windows ?

Following names are consider as a device / port in DOs. DOS devices cannot be used as folder names:

CON, PRN, AUX, CLOCK$, NUL, COM1, COM2, COM3, COM4, COM5, COM6, COM7, COM8, COM9, LPT1, LPT2, LPT3, LPT4, LPT5, LPT6, LPT7, LPT8, and LPT9.

so creating a folder in above names are not possible in windows.

But we can create them with some simple tweaks...

steps as follows .

From command line

to create a folder

mkdir \\.\d:\con (this will create con folder in "D" drive)

use the same method to delete the folder

rmdir \\.\d:\con (this will delete con folder from "D" drive)

4 comments:

jeri said...

Please correct the following
rmdir \\.\d:\con (this will delete con folder from "D" drive)

with

rd \\.\d:\con (this will delete con folder from "D" drive)

Albin Sebastian said...

Hi Jeri,

but both commands will work.

command "RD" and "RMDIR" will do the same function

New readers can try this command also

Thanks for the comment

Hapi said...

hello... hapi blogging... have a nice day! just visiting here....

Blogging In Web 2.0 Beta said...

I Want to link Exchange with You If You Would Find it Worth Then please Let me Know My Blog is http://eknol.blogspot.com/ With A Page Rank of 3. If Possible Than Use Title Blogging Tips,Tricks & Hacks

Blog Widget by LinkWithin