Batch file help!!

Solved/Closed
Bharath - Jan 30, 2010 at 10:12 AM
rizvisa1 Posts 4479 Registration date Thursday January 28, 2010 Status Contributor Last seen May 5, 2022 - Feb 1, 2010 at 08:25 AM
Hello,

Please some one help me with this...my problem is that i want to create a batch file that can save all the names of sub folders for a given folder into a txt file or csv file

what I mean is for ex if i have a folder "music" which has 200+ sub folders., each folder name being the album's name...I want all these names(folder name only) to be saved in a text file or a csv file.

I wanted to know how to create a batch file for this

3 replies

rizvisa1 Posts 4479 Registration date Thursday January 28, 2010 Status Contributor Last seen May 5, 2022 768
Jan 31, 2010 at 08:26 AM
Why batch ?

why not run the command

go to command prompt
go to the root folder from where you want to scan
type dir /ad /b /s > myfolderlist.txt
0
rizvisa1 Posts 4479 Registration date Thursday January 28, 2010 Status Contributor Last seen May 5, 2022 768
Jan 31, 2010 at 09:17 AM
ONE CORRECTION

dir /ad /b /s > myfolderlist.txt
0
hii


Thanx a bunch rizvisa1.u saved my day.i have a1 tb hardisk and like 600 movies.so i just wanted to keep a log of it.thanks thanks thanks!!!!!

The text file created had the whole path of each folder though.but then it was an easy task- i replaced it with notepad's replace function.thanxxx again.
0
rizvisa1 Posts 4479 Registration date Thursday January 28, 2010 Status Contributor Last seen May 5, 2022 768
Feb 1, 2010 at 08:25 AM
You are welcome. If you dont have sub folders within subfolders, but rather have all the folders at one level then you could try thing

go to to the target folder and type
dir /ad /b >myfolderlist.txt

this will create a file that contains all the sub folders at that level (it would not look at the whole tree of folder) and in which case you should have have to use notepad to remove the extra path info
0