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
Post a Comment