Saturday, January 21, 2012

How to hide files and folders using attrib command

Folder hiding is a simple way of keeping prying eyes away from your private documents. We all want to make our private folders hide. Just checking mark on ‘Hide’ button from folder’s properties is not a proper way to hide our folder. Everyone can view these hidden folders by putting check mark on ‘Show hidden files’ from folder options of the window explorer.

So today we will use Attrib command to hide our folders and files. Attrib allows a user to change the properties of a specified file and folder. Using attrib, the user has the capability of changing the file to have any of the below attributes:

Read only - allowing the file to be only viewed and not written to.
Archived - allowing Microsoft backup and other backup programs to know what files to backup.
Hidden - making the file invisible to standard users.
System - making the file an important system file.

How to hide files and folder using attrib command:

Open run window and type cmd, and then press enter. This will show you below Image:



Now type following command here
attrib +s +h <destination files/folder name with path>

Commands parameters are as follow:
+          Sets an attribute.
 -          Clears an attribute.
S          System file attribute.
H          Hidden file attribute.

For example, I have a folder in my D drive named sanjeev. I want to hide this folder using attrib command. So my command will be this:
attrib +s +h d:\sanjeev



Now this folder will not show to anyone even after putting check mark on ‘Show hidden files’ from the folder options.

To access this hidden folder you need to use run command and type full path of this folder as show below:



To unhide folder just put – sign in place of +

attrib –s –h <destination file/folder name with path>



Hope this will help you to protect your personal files and folder away from others.

Thanks & Regard

PRdeep Kumawat
Network & System Engineer


No comments:

Post a Comment