views:

71

answers:

2

hello i want to recursively list the absolute path to all files that end with mp3 from a given directory which should be given as relative directory.

i would then like to strip also the directory from the file and i have read that variables which are in a for-scope must be enclosed in !s. is that right?

my current code looks like this:

for /r %%x in (*.mp3) do (  
    set di=%%x
    echo directory !di!
    C:\bla.exe  %%x !di!
)

thanks!

+3  A: 

How about the command DIR...

dir /s/b *.mp3

... the above command will search the current path and all of this children. To get more information on how to use this command open a command window and type DIR /?

EDIT...

I have no idea how good this reference is but here is a DOS tutorial. It looks pretty detailed (then again I have been using DOS for a LONG time.)

DOS Tutorial

Here is a link to my site where I have a pretty complex batch file. It may give you a few ideas.

Batch Files

Matthew Whited
thanks! and now i would need every line in a variable
clamp
Good luck with that part. Check out the `FOR` command.
Matthew Whited
+1  A: 

You can add the results to a file with '> [filename]'

Andrew P