Save a list of files and subfolders

Discussion forum for all Windows batch related topics.

Moderator: DosItHelp

Post Reply
Message
Author
Maheshp
Posts: 6
Joined: 25 Jul 2011 20:22

Save a list of files and subfolders

#1 Post by Maheshp » 25 Jul 2011 20:35

Hi

i am looking for batch file which will retrive all the information from folder & subfolder & save the data on excel file
like f:\ >f:\filename.txt but this syntax don't work for sub folders
i will appreciate any help on this
e.g below should be output once i execute batch.
C:\Users\Desktop\Temp\TXT\sample sheet.xls
C:\Users\Desktop\Temp\sample1 sheet.xls

trebor68
Posts: 146
Joined: 01 Jul 2011 08:47

Re: Save a list of files and subfolders

#2 Post by trebor68 » 26 Jul 2011 08:14

If you only would have a list of the files use the following code:

Code: Select all

dir /s /b TEST\*.txt


The option "/s" for any subfolder and the option "/b" only list the file name.
In the Example is "TEST" a subfolder in this folder and "*.txt" the files.

In your Example:

Code: Select all

DIR /s /b C:\Users\Desktop\Temp\*.xls

Maheshp
Posts: 6
Joined: 25 Jul 2011 20:22

Re: Save a list of files and subfolders

#3 Post by Maheshp » 26 Jul 2011 10:53

Hi Trebor68
Thank you so much for help ! :D

Post Reply