Hiding files and folders using command prompt

Previously i wrote about hiding files and folders in windows using two methods. One was the beginners way while the other was a bit difficult one.  The beginners way method was way too simple and almost every computer user know it. While the other one was way too complicated for a layman.

Now in this article, I am going to share a simple method to hide files and folders using command prompt. First lets have a look at the topics summary :

Task: Hiding files and folders using command prompt.
Difficulty: Easy+
Time: 5 minutes or less.

Suppose if you want to hide a folder named “Omkar” on your D drive.
( The path to Omkar folder is “D:Omkar” ).

To hide this folder, just open your command prompt. And Type the code given below and press enter.

attrib +s +h D:Omkar

To unhide this folder, type the code given below and press enter.

attrib -s -h D:Omkar

I don’t know if you noticed it or not. But this is the same code which was shared previously on this blog in an article named “How to create a password protected folder without any software“. That article was a little advanced and would take about 10-15 minutes for a beginner level user.
I just made it easier so even a layman could do it.

Since both these articles uses the same principle of ‘attrib’. They both have similar drawbacks.

  • One is that anyone who knows the folder name can access the folder by typing the directory in the address bar.
  • Second is that the folder contents are visible in windows search.
  • For example, if there is a file named abcd.txt in your hidden folder. And if you search for this file using windows search. Then you will get this file in the search results.

The solution to these drawbacks is just to change the folder name as well as filename to something abstract.

In my opinion these are not the best methods to hide files or folders on a secure level. If you are hiding any random file for limited time duration then these can be very useful. But if you are planning to hide the file on a very secure level then you might consider using a third party software. I would recommend a software named folder guard. Its quite good and provides encryption options as well.