Polonus recently found this information on an undisclosed site:

Below to make a undeletable folder. Sometimes we have some important folders that we never want to be deleted but sometimes someone deleted them knowingly or unknowingly. We can actually make folders that cannot be deleted in Windows OS. It must be made using Command Prompt. It can only be deleted using Command Prompt.

Steps:

1.    Go to cmd.
2.    Change to the directory that you want.
3.    Assume i change to D:
4.    So,in Command Prompt,type D: and [enter].
5.    Type in this command “md \lpt1\\” without quotes and press enter.
6.    The folder will now in your D:
7.    Go and try and delete or rename it,you cannot do anything to it.
There are still many names that you can use to name the folder:

********************
-lpt1 until lpt9
-CON
-AUX
********************

To delete it:
1.    Go to Command Prompt again.
2.    Navigate to the directory.
3.    Type in “rd \lpt1\\” to delete folder.

The main reason for such hack would be for protection, but it can also be used in malicious ways. Lets break down the concept.

The keyword md literally means “Make Directory” in the command processor.

So we are trying to make certain file-named directories. Well, whats so special about it, you may ask?

First, lets check out some background information in this Microsoft post.

Try it out and see what happens! This is what I get:

renameInvalid

So we can’t create these named folders by normal means.. But then, how does the command prompt create them?

Because the UNC Path (Universal Naming Conversion) is not called inside pure DOS.

The only way you can delete the folder is to go back into the command prompt and replace cd with rd, which literally means “Remove Directory”.

 
If there is a way to make it, there is a way to delete it,
~!Donovan

Advertisements