How do i get a list of folders and sub folders without the files?

Inkey picture Inkey · Apr 18, 2013 · Viewed 367.5k times · Source

I am trying to print a list of the folders and sub folders of a directory to a file.

When I run dir /s/b/o:n > f.txt, I get a list of the files also. I only need the folders and sub folders.

Anyone know is this possible to do this from command line interface?

Answer

Endoro picture Endoro · Apr 18, 2013

Try this:

dir /s /b /o:n /ad > f.txt