title: Batch script file to convert every file in every folder one at a time
body: <p>What im trying to do is convert .ogg files stored in many different folders. What i NEED the batch script to do is go from the first folder and file , convert it and only then move on to the next file in the folder. Also during the conversion process a wave file is created, so i need it to be deleted at the end of the files conversion along with the original .ogg file. This is my code so far. It goes through every folder and file performing the oggdec producing massive amounts of wave files. I need the script to only do one folder and one file at a time  </p>
  
  <pre><code>for /r %%i in (*.ogg) do oggdec "%%i"
  for /r %%i in (*.ogg) do del "%%i"
  for /r %%i in (*.wav) do lame -m m   "%%i"
  for /r %%i in (*.wav) do del "%%i"
  
  @echo off
  etlocal enabledelayedexpansion
  set deletestring=.wav
  echo Ready to start
  echo.
  
  echo.
  for /f "delims==" %%F in ('dir /b /s /a-d ^| find "%deletestring%"') do (
      set oldfilename=%%~nxF
      set pathname=%%~dpF
      set newfilename=!oldfilename:%deletestring%=!
      Ren "!pathname!!oldfilename!" "!newfilename!"
      )
  echo.
  echo All done
  
  (
  </code></pre>
  
  <p>This code above almost works in that the end result is working, but unfortunately i need it to convert only one file at a time and delete the original .ogg and .wav before moving to the next .ogg file.So i need it to follow this rule
  Take the first folder and the first .ogg file do oggdec on file producing the .wav del the .ogg file do lame -m m on the .wav file producing the .mp3 file del the .wav file move on to the next .ogg file until all files in the folder are converted then move on to the next folder which may not be in the same folder.
  An example folder structure.     </p>
  
  <pre><code>Sounds/voice/greek
  Sounds/voice/English
  Sounds/voice/russion
  </code></pre>