get all directories name using cmd and save to text code example
Example: get all directories name using cmd and save to text
Open a command prompt (Start -> Run -> cmd Enter )
Navigate ( cd ) to the directory whose files you want to list.
Enter dir > output_file_name (e.g., dir > C:\dir. txt )
and press Enter .