Listing of x folder's content?

Discussion forum for all Windows batch related topics.

Moderator: DosItHelp

Post Reply
Message
Author
Faith
Posts: 1
Joined: 04 Mar 2011 08:06

Listing of x folder's content?

#1 Post by Faith » 04 Mar 2011 08:13

Hi,

I have a folder called "clips", inside this folder are .avi clips and folders (folders are empty). How would I go about listing the folder names and the .avi names into a simple text document? So:

examplefolder1
examplefolder2
example1.avi
example2.avi

I don't want the script to rename anything, I just want it to list the all the folders and .avi clips. Can this be done via batch?

Thanks :)

!k
Expert
Posts: 378
Joined: 17 Oct 2009 08:30
Location: Russia

Re: Listing of x folder's content?

#2 Post by !k » 04 Mar 2011 09:44

If folder's names have not dots

Code: Select all

dir /b /o:e > list.txt

otherwise

Code: Select all

dir /a:d /b > list.txt
dir *.avi /b >> list.txt

scienceguru1.bat
Posts: 44
Joined: 01 Jan 2011 20:54

Re: Listing of x folder's content?

#3 Post by scienceguru1.bat » 17 Mar 2011 19:41

if you also want the contents of the subfolder under "clips", then add:

Code: Select all

/s

right after the

Code: Select all

/b

in !k's script above

Post Reply