How can I recursively clear the "Hidden" file flag on Windows Vista?

7

A friend's computer was recently infected with a virus.

I hope the virus has been removed successfully. But, it appears that the virus set the "Hidden" flag on most directories and files on the system.

What's the most convenient way to clear this flag from selected directories and their contents?

erickson

Posted 2011-06-09T22:48:17.737

Reputation: 307

Answers

9

You are looking for the "attrib" command. Type attrib /? at a command prompt.

An example would be attrib -h *.* to remove the hidden attribute from all files in the directory, or attrib -h *.* /s to include subdirectories. Add the /d switch to reset the directories too.

KCotreau

Posted 2011-06-09T22:48:17.737

Reputation: 24 985

Anyone know how to make the * show? It seems only to happen when you do STAR.STAR, not just one star. – KCotreau – 2011-06-09T23:08:45.483

Thanks for the answer! Hope you don't mind; I have proposed an edit to escape the asterisks. You can do that with backslashes, or by enclosing text with backquotes (which makes give it a style for code). – erickson – 2011-06-09T23:22:16.830

You can also do this with -r (read only) -a (archive) -s (system) e.g. C:\Windows\System32\attrib.exe -r ..*.* /s /d see http://technet.microsoft.com/en-us/library/bb490868.aspx

– Tod Thomson – 2013-12-06T01:13:19.330

3

Download and run unhide (http://download.bleepingcomputer.com/grinler/unhide.exe).

It is for use when viruses (particularly fake failing HDD alerts) hide your files as part of what it does.

Works a treat for the odd occasion when these things happen here.

Windos

Posted 2011-06-09T22:48:17.737

Reputation: 10 080