Saturday, 13 June 2015

How to Hide or Unhide Folders Using cmd Attrib Command

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

There are three 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.

  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] FileName: Provides the location and name of the directory where files or folders are stored, Then provide the file or folder name and then set the attribute that you want to apply

Step 1

Open the command prompt.

To open the command shell 1, press Window+r and type "cmd" then press Enter or select from the startup menu

Step 2

Now go to the drive where your folder is stored in the drive. Let's use my new folder (A) stored in the E: drive then I type:

E:

Step 3

Now to hide the folder we need to type in the following command:

E:(drive_name where your folder exist) attrib folder_name +s +h +r

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 4

Now type in the following command to unhide the folder:

E:(drive_name where your folder exist) attrib folder_name -s -h -r

No comments:

Post a Comment