Hide files and folders using Command prompt trick

Do you ever wanted to hide files and folders on your computer? Yes! Previously, we learnt how to delete Windows password to access any Windows computer anonymously. So, even if you computer is password-protected, your private data is not secure. Usually, we have a lot of data which has to be protected from outside access and only Windows login password proves insufficient to serve the purpose. In such situations, it is better to use a command prompt secret trick to hide files on your computer. Today, I am posting easiest way of hiding files or folders using a command prompt trick. So, let us begin.

How to hide files and folders:

This is the simplest way of hiding files and folders on your computer. This trick works using just 2 commands. Let us get into steps of using this trick:

1. Press Win + R to get Run prompt. Type cmd and hit on Enter to get command prompt window.

Note: Win key indicates Window key.

2. Decide which file/folder you want to hide and copy its path. Say, I want to hide a folder named “xyz” and its path is: F:\xyz

3. In command prompt, enter this command:

attrib +s +h X

In above command, replace X with the path you copied in Step 2. So, in my case, the command becomes:

attrib +s +h F:\xyz

Hide files and folders

4. Hit on Enter and you will find your file/folder hidden.

Note: This trick hides files even if you have selected “Show hidden files” in Folder Options pane.

5. After hiding your private file, let us see how to restore your file. To unhide your file, use this command:

attrib -s -h X

Replace X with your file path.

Command prompt trick

If you want to hide a number of files/folders, you can create a new folder and add all your private data in this newly created folder. Now, the only thing you have to do is hide the newly created folder and your data is safe and secure from outsiders.

I hope you are now able to hide folders using this simple command prompt trick. You don’t need any extra software to do the job for you. Your private data is now 100% safe. Cheers!

Recommended: You might be interested in our article: How to post blank status on Facebook.

This was a short article on how to hide files and folders on your computer. If you have any problem in implementing this command prompt trick, please let us know in comments.

About Rajesh

Rajesh is a tech-blogger since last 3 years and is pursuing M.Tech from NITK, Surathkal.


  1. awesum !

  2. hi ,

    i want to be ur shishya !!! i have a doubt y attrib +s +h y not any other alphabet like +k +l ?? can u plz explain jus want to know !!


    • Well, these are predefined commands. +s is used to assign system file attribute, while +h assigns hidden file attribute. Thus, our computer treats the specified file as system file which needs to be hidden!
      I guess this will explain you the command. Thanks for adding value to the discussion.

  3. I am not all that the techie but this post was easy to follow.

  4. thank u for the explaination bro !! was awesome

  5. bro i need free mobile isd message website

Speak Your Mind