In this article we will discuss how to hide or unhide folders using command prompt.
Hiding Files and Folders from others is very common. Anyone can see hidden files on your computer by simply checking the Hidden Items in Windows Explorer. But in this method no one can see your folders except you.
This method provides security for your programs and important documents from other user.
What is attrib command ?
The attrib is a Windows CMD command which is used to set and remove file attributes. The attributes provide security to essential documents. It sets,displays and removes hidden, readonly archive file atrributes which is assigned for a directory or file. By using this command directly user can change the attributes of file.
There are four attributes in Windows files
- It makes files or folders invisible to the user to provide security for files or folders.
- It provides a backup of file. Hence help in recovering of files and folders.
- It is used to mark the files as an important system file, so it changes the priority of the file.
- This attribute means that no one can delete or make changes to that specific file.
Parameters of attrib command
+s : Sets the file attribute as a system file.
-s : Clears the system file attribute.
+r : Sets the file attribute as read-only.
-r : Clears the read-only file attribute.
+a : Sets the file attribute as archive.
-a : Clears the archive file attribute.
+h : Makes the file attribute as hidden not visible to use.
-h : Clears the Hidden file attribute.
To Hide File or Folder
- Open the folder or Go to the folder containing the file from your Windows Explorer. To hide the file or folder first copy the address or path of that folder or file.
2. Open Run by Right Clicking on Start Menu or Using Keyboard Shortcut (Ctrl+R).
4. In CMD, type attrib +s +h “Path To Your File”. Hit Enter. This is a command to hide your file or folder.
NOTE – You must know the folder/file path to unhide. If you forget the name of the file or folder, then Open Command Prompt and Enter the following command.
Type the drive name with : and press Enter. Type dir/a command and hit Enter. Now find your file or folder name from the list.
To Unhide File or Folder
- Open Command Prompt by typing cmd in Run.
2. To Unhide your file or folder, type attrib -s -h “Path to file or folder”. Press Enter Key. After doing this your file or folder will be unhidden.