How to create an un-modifiable folder



     This post is nothing related to any new trick or special method to do something special, it's just for fun and a little bit of challenging purposes. I think probably, everyone's familiar with windows OS and used it many times. Have you ever wondered or even try to make a directory or folder which can't be accessed or modified even by yourself. If  you ever been, then you landed exactly right place. Today we gonna do something useless and apart from any special or useful work.

     First step just try to make a folder in windows having name of like: "con" or "aux" etc. As soon as you try to create folder with these names or try to renaming any other pre-existing directory with this name, an error message popped out signifying that you can't create directory with this name. Windows doesn't allows us to create these directories but what if there's any way to create folders with these specific names. You can easily make it by following these steps.


  • First open the command prompt and navigate to the directory where you want to create folder.
  • You can simply use "cd" command to navigate between directories or simply open a command prompt by right click while holding shift key. 
  • Here type the following command  "md con\"  as it is without quotes.
  • Now you can easily see, you've successfully created the folder with specific name. Here in this example I've created a folder with name "con", you can try with any of the names provided in this context later.
     Now, if you try to rename or open this folder, Again an error message popped out. Even you can't delete this folder having superuser privileges or administrator permissions. So, Now, how to delete this folder. Obviously, it's an headache to have such folder which we can't use. There's obvious a different way to delete this folder. You can't simply press delete button and delete folder like this. To delete this folder, follow these steps to completely remove this folder.


  • Again open the command prompt and navigate to that directory.
  • Now, instead of md, you just have to replace md with rd, So the command looks like:
  • If all things go well, you can see the folder is gone. If you accidentally copied some files in that folder(drag n drop), it can't simply be deleted by this command.
  • For this purpose, type the following command in command prompt replace the FOLDER'S_DIRECTORY with the path of your folder :  
rd /s \\?\"FOLDER'S_DIRECTORY"


     Now let's get through the logic behind this activity. All programming languages have some keywords which can't be used in by any means. A keyword is a special word of a programming language which is particularly reserved for itself. You can't use that words in any variable name. As we simply know that windows has evolved from D.O.S. based operating systems which is also a kind of programming language. That's why you can't able to delete the folder manually. You have to go through the DOS's way to delete that folder. 

     There're some more keywords which you can experiment with. Some of the reserved keywords are: con, aux, lpt1, lpt2 ... lpt9, prn, nul, com1, com2 ... com9. All these reserved keywords serves special purposes and process to windows(e.g. con reserved for window's console, lpt reserved for ports etc.), that's why windows do not allows us to use these keywords. 

     Now, you can easily create these folders but still remembers you can't be able to make any kind of changes to this directory. You can easily use this method to trick your friends or as a challenge.

Comments

Popular Posts