Take the 2-minute tour ×
Super User is a question and answer site for computer enthusiasts and power users. It's 100% free, no registration required.

Is there a command on the Windows command-line that can list hidden folders?

I've tried dir -a:dh but that doesn't work for me.

share|improve this question
add comment

2 Answers

up vote 4 down vote accepted

Use the following command:

dir /a:hd C:\folder\

The difference between what you were typing and this command is that you were using a - to indicate the switch, not a /. In most windows command line applications, this doesn't matter, but in the case of the dir command, you must use a slash, not a dash.

The /a switch changes which attributes are displayed. h shows hidden files and d shows just directories. Make sure you keep the trailing slash on the end of the folder path. I just tested, and it worked fine.

share|improve this answer
add comment
  • dir/a should show hidden folders.
  • dir /a:d shows all directories.
  • dir /a:h shows all hidden files.

Try dir /adh (without the colon) to combine.

share|improve this answer
    
And "dir /ad-h" shows only non-hidden directories, like "dir". –  Andrew J. Brehm Apr 30 '11 at 11:40
    
Why the down vote? The answer is correct. –  Andrew J. Brehm Apr 30 '11 at 17:26
add comment

Your Answer

 
discard

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.