How to Hide a Folder in Windows 11 Using the Command Prompt

If you have sensitive files on your computer, simply clicking “Hidden” in the Windows 11 File Explorer properties menu is not secure. Anyone who clicks the “View” tab and enables “Show hidden items” will instantly see your folder, albeit slightly transparent.

If you want to truly conceal a folder so that it remains completely invisible—even when the “Show hidden items” toggle is activated—you must use the Command Prompt to mark the folder as a critical operating system file.

How to Apply the System Attribute

By using the attrib command, we can apply two flags simultaneously: +h (Hidden) and +s (System). Windows Explorer is hard-coded to completely ignore System files to prevent users from accidentally deleting them.

  1. First, locate the exact path of the folder you want to hide (for example, C:\Users\John\Desktop\PrivateTaxes).
  2. Click the Start menu, type cmd, and press Enter to open the Command Prompt.
  3. In the black terminal window, type the following command, making sure to replace the path in quotes with your actual folder path:
    attrib +h +s "C:\Users\John\Desktop\PrivateTaxes"
  4. Press Enter.

The moment you press Enter, the folder will vanish from your desktop or File Explorer. Even if you explicitly check the “Show hidden items” box in the View menu, the folder will remain entirely invisible.

How to Access or Unhide the Folder

To access the files inside, you can simply open the Run dialog box (Windows Key + R), manually type the exact path to the folder (e.g., C:\Users\John\Desktop\PrivateTaxes), and press Enter. File Explorer will open it instantly, despite it being invisible.

If you want to permanently unhide the folder and return it to normal, you must use the Command Prompt again, this time using minus signs to strip away the attributes.

  1. Open the Command Prompt.
  2. Execute the following exact command:
    attrib -h -s "C:\Users\John\Desktop\PrivateTaxes"
  3. Press Enter.

The folder will instantly reappear in its original location, behaving exactly like a standard Windows directory.

Get the best tech tips delivered straight to your inbox.

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