Can’t delete or modify folders with reserved names

Ever want to create a folder that can’t be deleted ? yes it can be handy you see this by some leechers in FTP sites.

Some malware (including virus’s and other types of programs with bad intentions) as well as some hardening programs and utility’s sometimes create files and directorys with illegal names.
Why "illegal" ?
Because some names such as LPT1, LPT2, LPTx, PRN, CON and more are reserved as
they have a unique meaning to the operating system.
Trying to rename/delete/modify a file or directory with such an illegal file name will return

 

so how to do this.

Step one :  go to the CMD

C:\>md \\.\c:\LPT1

C:\>md \\.\c:\COM1

C:\>md \\.\c:\COM2

try to delete this folders. You can’t  no security properties are there and take owner etc. IT will not work.

The reason why the line above would work is because of it’s prefix:

Do this.

C:\>rd \\.\c:\LPT1

C:\>rd \\.\c:\COM1

C:\>rd \\.\c:\COM2

Now the folders are gone.

Posted May 21, 2010 by Robert Smit in Security

Tagged with

  • Tag