How to Use the Windows 11 attrib Command to Hide Files from File Explorer

The Limits of Right-Click Hiding

If you want to hide a sensitive document on a Windows 11 computer, the standard method is to right-click the file, select “Properties,” and check the “Hidden” box.

The problem with this method is that it is widely known and easily bypassed. Anyone who opens File Explorer, clicks the “View” tab, and selects “Show > Hidden items” will instantly see your files, slightly faded but fully accessible.

If you want to hide a file or a directory more securely—making it invisible even when a user has “Show Hidden items” enabled—you must interact directly with the core NTFS file system using the Command Prompt. You can do this using the attrib (Attributes) command.

Step 1: Understanding Windows File Attributes

Every file and folder on a Windows hard drive possesses specific attributes that tell the operating system how to handle it. The most common are:

  • R (Read-only): The file cannot be modified or deleted.
  • A (Archive): Indicates the file has changed since the last backup.
  • H (Hidden): The standard hidden flag.
  • S (System): A critical flag. It tells Windows that the file is an essential part of the operating system itself.

The secret to super-hiding a file is combining the H and S flags. By default, Windows 11 hides all System files to prevent users from accidentally deleting them, even if standard Hidden files are set to be visible.

Step 2: Super-Hiding a File or Folder

Open the Command Prompt (click Start, type cmd, and press Enter). You do not necessarily need Administrator privileges to do this to your own personal files.

Let’s assume you have a folder named “Financial_Records” located on your desktop that you want to completely vanish from File Explorer.

The syntax for adding an attribute is to use a plus sign (+) followed by the attribute letter.

Type the following command:

attrib +h +s "%USERPROFILE%\Desktop\Financial_Records"

Press Enter.

If you look at your desktop, the folder is gone. If you open File Explorer and enable “Show Hidden items,” the folder remains completely invisible.

Step 3: Accessing the Super-Hidden Folder

Because the folder is invisible to the graphical user interface, you cannot click on it. However, the data is still there, and the path is still valid.

To access the files inside, you must explicitly tell File Explorer to go to that exact path.

Click inside the address bar at the top of File Explorer and type the exact, full path to the folder (e.g., C:\Users\YourName\Desktop\Financial_Records) and press Enter. The folder will open normally, allowing you to view and edit the files inside.

Step 4: Unhiding the File or Folder

When you want to return the folder to its normal, visible state, you must use the Command Prompt again.

The syntax for removing an attribute is to use a minus sign (-). You must remove both the Hidden and System attributes simultaneously.

Run this command:

attrib -h -s "%USERPROFILE%\Desktop\Financial_Records"

The folder will instantly reappear on your desktop.

Step 5: Applying Attributes to Contents (Recursively)

If you use attrib on a folder, it hides the folder itself. However, if a sophisticated user searches your hard drive using a specialized tool, the files inside the folder might still appear in the search results because they do not inherit the System attribute automatically.

To apply the Hidden and System attributes to the folder, and force those attributes onto every single file and sub-folder inside it, you use the /s (subfolders) and /d (directories) flags.

attrib +h +s "%USERPROFILE%\Desktop\Financial_Records\*" /s /d

A Critical Warning: Do not use the +s attribute maliciously on other users’ files, and never randomly apply or remove attributes from the C:\Windows\ directory, or you will irreparably damage your operating system’s ability to boot.

Get the best tech tips delivered straight to your inbox.

Join thousands of readers mastering Apple, Google, Microsoft, and Linux.