Can’t delete or modify folders with reserved names   Leave a comment

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

Access Denied

 

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.

Advertisements

Posted May 21, 2010 by Robert Smit [MVP] in Security

Tagged with

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

  • Twitter

  • %d bloggers like this: