Super User is a question and answer site for computer enthusiasts and power users. It's 100% free, no registration required.

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

If you want to make in command line in windows all files and directories non-hidden attrib -s -h * will not work.

share|improve this question
Before you do this, are you just trying to view the hidden files in Explorer? If yes, you only need to edit a setting in Windows Explorer... not permanently discard the hidden setting of files! (Folder options > View > Show hidden files, folder and drives / Hide protected operating system files) – ADTC Sep 15 '13 at 19:45
@ADTC Notice the self-answer. – Michael Kjörling Sep 15 '13 at 19:46
Yes, just want to warn the asker that his command line script will permanently discard the hidden and system attribute for all files on his disk, whereas the options I mention will simply show these files in Explorer. It really looks like he just wants to see the files, not actually change their attributes to visible/non-system (I would consider changing them system-wide a very bad thing to do). – ADTC Sep 15 '13 at 19:48
Is this a question? – Ƭᴇcʜιᴇ007 Sep 15 '13 at 20:01

You didn't mention which OS are you using, but since the command that you used

attrib -s -h *

didn't work, I'm guessing you used it without administrator priviliges.

The method I use is:

Run command prompt (Start -> Run -> CMD for XP, or for Vista and 7 Start -> type CMD in search box, right click and run as Administrator), type the following command:

attrib -H -S D:\yourfolder\*.* /S /D

This will remove the Hidden and System attribute of all files in the yourfolder folder on the D: drive.

The /S and /D arguments are optional.

/S will recurse down into all sub folders and

/D will unhide the folders themselves if they have the System or Hidden attribute set.

I regularly use this to clean customer virus infected flashdrives, as some viruses tend to hide your files and replace them with infected copies of the virus itself.

share|improve this answer

For hidden files:

for /f "delims=|" %x in ('dir /a:h /b') do @attrib -h "%x"

For system hidden files:

for /f "delims=|" %x in ('dir /a:sh /b') do @attrib -s -h "%x"

These will affect all hidden (and system) files and directories in the current directory

share|improve this answer
please take note of the comments – ADTC Sep 15 '13 at 19:53

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.