Question:

How do I get CommandPrompt to show only the sub-directories not including all filenames as with (dir) command?

by  |  earlier

0 LIKES UnLike

I have lots of files in this one directory but I also have subdirectories. Please let me know.

 Tags:

   Report

2 ANSWERS


  1. dir /ad /s


  2. There is a "/ad" flag to the "dir" command, which says "only display items with a directory attribute".  So, "dir /ad" displays only subdirectories.  If you want to do this recursively, add "/s" to list items within subdirectories as well, as in "dir /ad /s".  Finally, if you only want the names, and not all the other information that "dir" normally includes add "/b" for "bare output", as in "dir /ad /s /b".

    - kb -

Question Stats

Latest activity: earlier.
This question has 2 answers.

BECOME A GUIDE

Share your knowledge and help people by answering questions.