Guide: Use Dir/Attrib Command to Show Hidden Files

Learn how to use dir/attrib command to show hidden files in this post. What’s more, there’re other ways for you to show hidden files and fix Windows 10 show hidden files not working.

Penny

By Penny / Updated on April 3, 2024

Share this: instagram reddit

How do you list hidden files in your directory?

In computing, a hidden folder (directory) or hidden file is a filesystem utility that cannot display by default when showing a directory listing.

   
   
   
       

Hi, everyone! What’s the command to show and hide hidden files by default? Thanks.

- A user from cPanel

Those users proficient in PCs often use various utilities to modify file attributes of files or folders according to their needs. But non-tech users might only need to show hidden files in Windows. If it happens to be your case, please read further.

Part 1. What is the use of DIR command?

Let’s begin with powerful CMD like dir command.

dir

For computers, dir (directory) is a command in various computer operating systems that shows computer files and directories. It’s one of the fundamental commands for navigating file systems.

How to use the dir command to show hidden files?

Please get an overview of its common dir commands before using them to show hidden files.     

Notes:✎...   
dir /ah: Show all hidden files and hidden directories in the current directory.
dir /ah-d: Show all hidden files in the current directory (the one you’re in) but not hidden directories.
dir /a: Show all files and directories including hidden files and directories in the current directory.

How to use the dir command to show hidden files? Please refer to the following steps.

Step 1. Type “cmd” in the search bar and click “Run as administrator” to open the command prompt window.

run-as-administrator

Step 2. Copy “dir F: /a:h /b /s” in the command prompt window and hit “Enter” or press “OK” to show hidden files in F drive.

dir-cmd

You can also replace F with your needed drive letter. After the process, you can check whether these hidden files are visible to you or not.

Part 2. What is ATTRIB in computer?

Besides the dir command, the attrib command is another practical CMD for you to modify and set the file attributes of a file/folder.

attrib

More conveniently, it runs from the Command Prompt in all versions of Windows.

How to use the attrib command to show hidden files?

Please have a closer look at the following four conventional attributes. After that, you’re ready to use the attrib command to show hidden files.   

Notes:✎...   
Ready-only (R): Users are not permitted to change or add data to the read-only files.
Hidden (H): MS-DOS commands like dir and Windows utilities like File Explorer will not show hidden files by default.
System (S): Designate a file/folder as an important file system and change its priority.   
Archive (A): Given that there’re some changes to the hosting file after the last backup, the backup software will automatically delete it after making a full/incremental backup.

Step 1. Type “cmd” in the search bar and click “Run as administrator” to open the command prompt window.

run-as-administrator

Step 2. Type “attrib –h –r –s /s /d G:\*.*” in the command prompt window. In this case, the letter G is the drive letter of your partition that includes your hidden files. You can replace G based on your needs.

attrib-cmd

Step 3. After the process, you’ll find a new folder with your desired files saved on your Windows PC. You can also change their formats and store them in another path.

As you can see, the attrib command is designed to show hidden files. Even if the attrib command cannot work, your desired files might be deleted instead of hidden. Then you can move to the last section to recover deleted files.

Part 3. Another two methods to show hidden files

The above methods describe how to use CMD show hidden files. In this part, you can show hidden files via File Explorer or Registry.

Solution 1. Show hidden files Windows 10/11 via File Explorer

Let’s perform how to show hidden files Windows 10/11 using File Explorer.

Step 1. Press “Win +E” to open Windows File Explorer. Under the View tab, click the “Options” button.

file-explorer-view-options

Step 2. When it comes to Folder Options, click View > Show hidden files, folders, and drives > Apply. Please remember to click “OK” to close the window.

show-hidden-files-folders

Solution 2. Show hidden files Windows 10/11 via Registry

Windows 10 shows hidden files not working! You can modify the registry to show hidden files if you’re proficient in PCs. Let’s show how it works.

Step 1. Press “Win + R” to open the Run box and type “regedit” in the box to open it.

regedit

Step 2. Go to this path:

Computer\HKEY-Local-MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Explorer\Advanced\Folder\Hidden. Then set the value data as “1” to show hidden files, folders, and drives.

hidden-value

Further reading: How to fix the dir/attrib command not working?

As mentioned above, if the dir/attrib command/Windows File Explorer fails to reappear hidden files, which suggests your needed files might be in a deletion state.

At this point, you’ll be prompted to restore files from backups or ask for help from data recovery software to recover permanently deleted files.

Since many users have not cultivated a good habit of creating backups via free Windows features or backup software, there’s no better way than using professional software like MyRecover.   

Powerful features & friendly design:
Recover the deleted/lost Word, Excel, PPT, PDF, photos, videos, audio, folders, and other 200+ types of data from HDD, USB, SD cards, etc.   
Keep the recovered files based on their original paths, filenames, and format.   
During Quick Scan and Deep Scan, enter filenames in the search bar to locate your desired files quickly or wait to find all the deleted and other lost files on your PCs.
Support NTFS, exFAT, FAT32, and ReFS file systems.

Download MyRecover on your Windows 7, 8, 10, 11, or Windows Server computers to restore your permanently deleted files!

Download Software Windows 11/10/8/7/Server
Secure Download

Step 1. Run MyRecover on your PC, and hover the mouse over the partition that includes your desired files. Then click Scan.

select-location-to-scan

Step 2. Quickly locate your needed files by Name, Date, Type, Size, or Path. You can also wait to view all the deleted and other missing files after Quick Scan and Deep Scan.

scanning-drive

Step 3. Go to the Deleted Files/Other Missing Files folder, and click “Recover x files” to get your selected files back. After recovery, please save them in a new location.

select-deleted-word-files-click-recover

Wrapping up

This post describes how to use the dir command to show hidden files or use the attrib command to show hidden files. You can refer to the last two solutions if you’re familiar with CMD.

If you want a more straightforward method, you can use Windows File Explorer to show hidden files, folders, and drivers.

If the above methods are useless, you’d better go to the last part and seek help from MyRecover. To prevent data loss at the source, it’s time for you to create regular file, disk, partition, or system backups using free backup software for Windows.

Penny
Penny · Editor
Penny works as an editor at AOMEI Technology, while she's a tester and editor for AOMEI Data Recovery Tools. She enjoys helping users with data recovery issues on Windows and iPhones using simple and practical solutions. Outside of work, she has a strong affection for pets, particularly giant pandas.