I would like to receive the following output.
Suppose the directory structure on the file system is like this:
-dir1 -dir2 -file1 -fi
In windows, to list only directories:
dir /ad /b /s
to list all files (and no directories):
dir /a-d /b /s
redirect the output to a file:
dir /a-d /b /s > filename.txt
dir command parameters explained on wikipedia