tags:

views:

29

answers:

1

Basically i want to run this in ever Sub folder

for %%i in (*.m4a) do faad "%%i"
for %%i in (*.wav) do oggenc "%%i"
for %%i in (*.m4a) do del "%%i"
for %%i in (*.wav) do del "%%i"

it works great but i have to manually change dir and re run eg.

cd res  
cd music
for %%i in (*.m4a) do faad "%%i"
for %%i in (*.wav) do oggenc "%%i"
for %%i in (*.m4a) do del "%%i"
for %%i in (*.wav) do del "%%i"
cd..
cd Sounds
for %%i in (*.m4a) do faad "%%i"
for %%i in (*.wav) do oggenc "%%i"
for %%i in (*.m4a) do del "%%i"
for %%i in (*.wav) do del "%%i"
cd..

and the list goes on. Problem is i have hundreds of sub folders, so it would take forever is there a way i can run my little script automatically in All sub directory's starting with a defined dir
such as

for /f "usebackq delims=|" %%f in (`dir /b /s *.m4p`) do faad.exe "%%f"

Any help would be apreciated

+1  A: 

I figured it out for my self All i have to do is point to the dir with the m4a files and the code does the rest, It will look though every sub folder also

cd Music

for /r %%i in (*.m4a) do faad "%%i"

for /r %%i in (*.wav) do oggenc "%%i"

for /r %%i in (*.m4a) do del "%%i"

for /r %%i in (*.wav) do del "%%i"

For your information.This scpipt Looks for m4a files, uses faad to convert to wave file`s The wave files are then get converted to Ogg format using oggenc The m4a files are deleted The wave files are deleted

kam