How to unhide a Windows folder or file with its hidden attribute grayed out

How to unhide a Windows folder or file with its hidden attribute grayed out

by Mihai Neacsu on 24 June 2014 · 12232 views

We covered how to show hidden files in Explorer, but how do you remove the hidden attribute of a file when that attribute is grayed out? In this tutorial, we'll show you how to change the hidden attribute using the command prompt command ATTRIB.

To make things easier to follow, let's start with an example of such a file, the Thumbs.db file on the Desktop. Thumbs.db is a thumbnail cache used by Windows to display thumbnail images faster. If you don't see such a file on your desktop, you probably have regular hidden files and system files set to not be shown in Folder Options. Follow this tutorial to make them visible.

1 full How to unhide a Windows folder or file with its hidden attribute grayed out

If you're still not seeing a Thumbs.db on your desktop then maybe you never placed an image on your desktop before, or maybe you just have thumbs turned off, or other scenario. In any case, you can use any hidden file with this tutorial, as long as it is not being used by another program while we try to temper with its attributes.

I will use Thumbs.db on my desktop as the example. Right-click on your file, choose Properties and you'll have a window similar to the one above. Notice the location of the file "D:\Users\Mihai\Desktop" - we'll use that later on.

We'll first take a look at what attributes the file has

Open a command prompt. It can be a normal command prompt or an elevated command prompt. Just to be on the safe side, open an elevated command prompt by pressing Win+X and choose Command Prompt (Admin). Click Yes if UAC pops up.

We'll use the command ATTRIB to show and change the attributes of the file. Typing attrib /? in cmd will show us the list of available parameters. You can use uppercases or lowercases to type the command and its attributes, it works either way.

2 full How to unhide a Windows folder or file with its hidden attribute grayed out

Next, type attrib "the full path of the file or folder" - it must include the extension of the file and it can be without quotes if no spaces exist in the path.

In my example, I typed attrib "C:\Users\Mihai\Desktop\Thumbs.db". This will show the current attributes of the file, which in my case are A(archive) S(system file) H(hidden) I(not content indexed).

3 full How to unhide a Windows folder or file with its hidden attribute grayed out

I want to remove the H(hidden) attribute of the file. For this I must type a command which includes attrib -h in order to remove the hidden attribute. Typing attrib -h "full path of the file with extension", in my case attrib -h "C:\Users\Mihai\Desktop\Thumbs.db", will not work and I get the message Not resetting system file - C:\Users\Mihai\Desktop\Thumbs.db.

So instead I must type attrib -h +s "C:\Users\Mihai\Desktop\Thumbs.db". This will remove the H attribute and keep the S(system file) one.

4 full How to unhide a Windows folder or file with its hidden attribute grayed out

That's it. The file no longer has the Hidden attribute, as you can see by right-clicking on it and choosing Properties.

5 full How to unhide a Windows folder or file with its hidden attribute grayed out

The checkbox is still grayed out because the file still has the S attribute. To remove the S attribute type attrib -s "full path of the file with extension". Alternatively, you can just type from the start attrib -h -s "full path of the file with extension".

The hidden checkbox now becomes usable again.

That's it. If you have questions, don't hesitate to leave a comment.

Comments (0)
Featured Articles