Header Ads

How to hide a folder completely in Windows using Attrib command


Today, privacy is one of the hot topic. The technique of hiding files and folders comes in handy when you are using a computer, which is used by more than one person. This article will show you a techie way to hide files and folders in Windows using command line.
How to hide a folder completely in Windows using Attrib command | TekkiPedia
How to hide a folder completely in Windows using Attrib command
The attrib command is very helpful for hiding a folder completely, in other words by using attrib command our folder is hidden and isn't visible when we select to show all files and folders. This command provides security benefits for our software programs and important documents from other users.

What is attrib?
The attrib command is a Windows command. The main purpose of this command is to remove and/or set file attributes (hidden, read-only, system and archive). The attributes provide complete security. It displays, sets or removes the read-only, hidden and archive file attributes assigned for a file or directory.

It allows a user to change the file attribute directly using this command. Let's understand how it works.


There are four attributes in Windows files:


Hidden - It makes files or folders invisible to the user to provide for safety of the files or folders.

Read-only - It provides the read-only attribute to the file, in other words no one can delete or make changes to that specific file that has the read-only attribute.

Archived - Provide a backup of file. Hence help in recovering of files.

System - Mark the file as an important system file, hence change the priority of the file.

Parameters of attrib command:

+r : Used to set the file attribute as read-only.

-r : Used to clear the read-only file attribute.

+a : Used to set the file attribute as archive.

-a : Used to clear the archive file attribute.

+s : Used to set the file attribute as a system file.

-s : Used to clear the system file attribute.

+h : Used to make the file attribute as hidden not visible to the user.

-h : Used to clear the hidden file attribute.

[Drive:/][Path] FolderName: Provides the location and name of the directory where files or folders are stored.


When you hide a folder using other ways and select 'show hidden files and folders' in Folder options, it will show your hidden folders as shown below:
How to hide a folder completely in Windows using Attrib command | TekkiPedia
Hidden Folder
So, using attrib command is a best and secure way to hide your private folders.

How to hide or unhide folders and files:

The main advantage of hiding using the attrib command is that when we click on the show hidden files option in Windows then the file or folder isn't shown.

For hiding files and folders we need to use a simple procedure. In the following scenario I first created a new folder to show how to hide or unhide a folder.

Choose the destination folder that you want to hide or unhide. I created a new folder (
Folder1) in my C: drive.

Step 1 : Open the command prompt.

Step 2 : Now to hide the folder we need to type in the following command and hit enter:

attrib FOLDER_PATH +s +h +r

How to hide a folder completely in Windows using Attrib command | TekkiPedia
Hiding folder using attrib command
Now you see the advantage of this command. Open your drive and check that your destination folder will not be there since it is now hidden.

Hiding using this command will provide you the extra advantage that they aren't visible when you show your hidden folder through "Organize" -> "Folder and search" -> "view" -> "show hidden files and folders".

Step 3 : Now type in the following command to unhide the folder:


attrib FOLDER_PATH -s -h -r

How to hide a folder completely in Windows using Attrib command | TekkiPedia
Unhide folders using attrib command
Note: if you want to hide your destination folder completely then you need to delete your recent visit list from your system.

Powered by Blogger.