The prior two answers lack key explanations and understandings.
A CSV is a comma separated values file. Excel is LIKELY (but not definitely) your default program for reading CSV files. CSV files are text files with their fields separated by commas.
Running the commands suggested will not, strictly speaking, create a CSV. The fields (directory name, size, date modified, etc) will NOT be separated by commas. They WILL be in a fixed width. What I would suggest, so that you are not "cheating" by file name and that you understand more clearly what you are doing is to run the command in a command prompt
DIR /AD X:\ > C:\RootDirs.TXT
Where x: is the optical drive you want the listing from.
The DIR /AD X:\ command should list ONLY directories - you requested "all those folder names" and sends the output to the file "C:\RootDirs.txt" INSTEAD of to the screen. Then from Excel, go to the File Menu and select "Open" and specify Text files then look in C:\ for the RootDirs.TXT file. once open and loaded, you can use Excel's Text-To-Columns feature to convert the fields to columns based on fixed width fields (there will be no commas unless the folder names had them at the start). Once that's done, resave as an Excel file.
If you don't care about the date of the folders and other data associated with them, add a /B to the above command and it will ONLY list the folder names. You can then open the file in notepad and copy and paste into excel or open in Excel and resave as an Excel file. Example:
DIR /AD /B X:\ > C:\RootDirs.TXT