How to get list of folders in a .cmd script -


i want list of folders in directory.

here's how i'm trying it:

for /d %%a in (*) dir "c:\users\cowman\foldera" /a:d /o:n /b "%%a" >> get_dirs.txt 

this gives me list of folders in foldera. however, unfortunately lists folders multiple times. want them listed 1 time. how them listed 1 time ?

dir "c:\users\cowman\foldera" /a:d /o:n /b > get_dirs.txt 

use > create file anew; >> append existing file.

or, if want listing of directories within subdirectories of target, use

dir "c:\users\cowman\foldera" /a:d /o:n /s /b > get_dirs.txt 

Comments

Popular posts from this blog

java - WrongTypeOfReturnValue exception thrown when unit testing using mockito -

php - Magento - Deleted Base url key -

android - How to disable Button if EditText is empty ? -