logo
Windows 8 Hide or Unhide Files and Folders with Command Prompt

How to Hide or Unhide Files and Folders with Command Prompt

By Achilles Hill | Last Updated

Supposing that you hide the important files and folders in your computer by means of downloaded softwares, you can think about hiding them by using the built-in Command Prompt. Moreover, after they are hided through cmd, they can be displayed again. And this text will show you how to hide or unhide files and folders with cmd immediately.

Video guide on how to hide or unhide files and folders with CMD:

Hide and unhide folders with Command Prompt:

1. Hide folders

Example: Hide a folder named "Documents" in Disk C.

documents folder in c disk

Way 1: Directly use an attrib command to hide the folder.

Step 1: Simultaneously press Windows key and R key to open Run dialog box, input cmd and click OK to open Command Prompt.

input cmd

Step 2: Input "attrib +s +h c:\documents" (without double quotation marks) in the Command Prompt window and click Enter.

input attrib command

Tips: In this attrib command, "+" stands for setting an attribute, "s" represents system file attribute and "h" means hidden file attribute. Moreover, "c:" is the drive letter and "documents" is the folder name. By analogy, if you want to hide a folder in another hard disk, you can use the attrib command by changing the drive letter and folder name.

For instance, suppose you would like to hide a folder titled "Summary" in E disk, you can input "attrib +s +h e:\summary" (without double quotation marks) in the Command Prompt and press Enter.

enter attrib command

Way 2: Enter the disk directory and then use an attrib command to hide the folder.

Example: Hide a folder called "Summary" in Disk E.

Step 1: Type e: in the cmd and tap Enter to go to Disk E directory, as shown in the following picture.

go to e disk directory

Step 2: Input attrib +s +h summary and press Enter.

enter attrib command

Tips: Use this attrib command through changing the folder name (referred to "summary") to hide another folder.

2. Unhide Folders.

Accordingly, there are two methods to unhide folders.

Method 1: Directly use an attrib command to unhide the folder (referred to "Documents" folder in Disk C).

Input attrib –s –h c:\documents and hit Enter.

enter attrib command

Note: In the attrib command, "-" means clearing an attribute.

Method 2: Go to the disk directory in cmd and then use an attrib command to unhide the folder ("Summary" folder in E disk).

Step 1: Enter e: and tap Enter.

go to e disk directory

Step 2: Input attrib –s –h summary and press Enter.

enter attrib command

Hide and unhide files with Command Prompt:

1. Hide files

Example: Hide a txt file named "goals" in Disk E.

Enter attrib +s +h e:\goals.txt and tap Enter.

input attrib command

Tips: "goals.txt" refers to the full name of the document (including file extension name). So, you can change the file name and use the attrib command to hide other files.

2. Unhide files.

Input attrib –s –h e:\goals.txt and press Enter to unhide the "goals" document.

input attrib command

Now, you can try the above methods and see if they work well in your computer.

Related Articles: