[Stepwise Guide]: How to Use DIR Command to Show Hidden Files in Windows 11, 10

This guide explains how to use the dir command in Command Prompt to display hidden files in Windows 10 and Windows 11. It covers various dir command options and switches, helping users list all hidden files on their system efficiently.

By @Emma
Last Updated July 2, 2025

What is Dir Command?

The "dir"command is a built-in command-line utility in Microsoft Windows that allows users to view the contents of a directory (folder) directly from the Command Prompt (CMD). It lists files and subdirectories in a specified path and provides essential details such as file names, sizes, last modified dates, and file attributes (like hidden, read-only, or system).

Unlike navigating with File Explorer, "dir" gives you a text-based, customizable way to inspect files, especially useful for advanced users, script writers, and troubleshooting tasks.

How to Use Dir Command to Show Hidden Files?

To use the dir command in Windows Command Prompt (CMD) to show hidden files and folders, follow these steps:

Step 1. Open Command Prompt as an Administrator

Before running dir commands to show hidden files, it is necessary to run Command Prompt as administrator. There are 3 ways to achieve that.

1: Press "Win + S" (Windows Search shortcut). Type "cmd" or "Command Prompt". Click "Run as administrator".

2: Press "Win + R" to open the Run box. Type "cmd" and press Enter.

3: Open File Explorer (Win + E). In the address bar, type cmd and press Enter (CMD will open in the current directory).

Step 2. Run Dir Commands to List All Hideen Files

Now you can run the proper dir commands in Command Prompt window to list and show hidden files. Next we will use “H:”drive as the example.

✔️Show Only Hidden Files

h:

dir /a:h

This will specifically list files (and not directories, by default) that are marked as hiddenin the current location.

✔️Showing Only Hidden Directories (Folders)

h:

dir /a:hd

This “d ”attribute will showonly directories (folders)with the hidden attribute.

✔️Show Hidden Files with Bare Output

h:

dir /a:h /s /b

This will list the full path and name of every hidden file and hidden directory found in the current directory and all of its subdirectories, without any additional information (like size, date, or summary counts)

Other Methods to Show Hidden Files

While “dir”command is powerful for command-line users to list and show hidden files, Windows offers other convenient methods to show hidden files, especially for those who prefer a graphical interface. Here are the most common alternative methods:

1. Use File Explorer Options

This is the most common and user-friendly method for showing hidden files and folders on Windows 10.

Step 1. Open File Explorer: Click the folder icon on your taskbar, or press Win + E.

Step 2. Navigate to the "View" tab: In the File Explorer ribbon at the top.

Step 3. Simply check the box next to "Hidden items."

For Windows 11 specifically: Click "View" -> "Show" -> "Hidden items."

2. Use the Control Panel

This method accesses the same "Folder Options" settings as the older Windows Explorer method but through the Control Panel.

Step 1. Right-click the Start button and select "Control Panel" or "Settings" (then search for "Control Panel"). Alternatively, type "Control Panel" into the Windows search bar and press Enter.

Step 2. Navigate to Folder Options (or File Explorer Options):

If your Control Panel "View by" is set to "Category," click on "Appearance and Personalization," then click on "Show hidden files and folders" under "File Explorer Options."

If your Control Panel "View by" is set to "Large icons" or "Small icons," simply find and click "File Explorer Options" (or "Folder Options" in older Windows versions).

Step 3. In the "File Explorer Options" (or "Folder Options") window that opens, click on the "View" tab. Under "Hidden files and folders," select the radio button "Show hidden files, folders, and drives."

3. Run Attribute Commands

Last but not least, the attrib command in Command Prompt offers a powerful way to manage file attributes, including showing hidden files. Just launch Command Prompt as an administrator, and run the following command:

attrib -h -r -s /s /d E:\*.* (Replace E with your actual drive letter)

Further Reading: What If Hidden Files Are Also Lost or Deleted?

While the methods above are effective for showing hidden files, sometimes the problem runs deeper than just a file attribute. Files might become hidden due to system errors, malware, or accidental deletion, and simply changing their visibility won't bring them back. In such critical scenarios, a dedicated data recovery solution becomes indispensable.

🌟MyRecover is professional data recovery software designed to retrieve files lost due to various data loss scenarios, including:
  • Accidental Deletion: Recover files that have been permanently deleted from the Recycle Bin or using Shift + Delete.
  • Disk Formatting: Retrieve data from accidentally formatted hard drives, USB drives, or SD cards.
  • Partition Loss/Damage: Recover files from lost, deleted, or corrupted partitions.
  • System Crashes or OS Problems: Access and recover data even when your Windows system fails to boot.
  • Virus Attacks: Help restore files that have been corrupted, hidden, or deleted by malicious software.

If you've tried to show hidden files but suspect they are truly gone, MyRecover provides a reliable solution to get your valuable data back. Just download the software, scan the disk and recover lost or missing files.

MyRecover
Easy Data Recovery Software
  • 500+ Devices Supported | SSD, HDD, USB Flash Drive, SD Sard, etc.
  • 1000+ File Formats Supported | PNG, MP4, MP3, TXT, ZIP, MSG, etc.
  • 500+ Data Loss Scenarios | Deletion, Format, System Crash, Virus Attack, etc.

Wrap Up

Now, you should know how to use dir command to show hidden files. Whether you prefer the directness of the Command Prompt's "dir" and "attrib" commands, the user-friendly graphical interface of File Explorer Options, or the traditional path through the Control Panel, you can get the step-by-step instruction.

However, it's crucial to remember that sometimes files aren't just hidden; they are truly lost or deleted. In those more severe data loss scenarios, relying on a robust data recovery solution like MyRecover is a better choice.