Windows Batch File - Recursive Looping Through sub-directories, ffmeg

32 views Asked by At

I have found a wonderful BAT-file that is very effective in converting MKV to MP4

@echo on
CD /D %~dp0
for /R %%f IN (*.mkv) DO ffmpeg -i "%%f" -c copy "%%~nf.mp4"
pause

It runs from a Mainfolder and looks into all subfolder and do the conversion automatically without any intervention.

Only issue is that it also moves the newly creted MP4 to Mainfolder where the BAT-file is

How can I edit the BAT-file to stop moving the MP4 to Mainfolder?


StartCondition:
C:\
├───MainFolder

  • MKVtoMP4.bat

    └───────SubFolder
    - Movie.mkv

Result after running BAT-file:
C:\
├───MainFolder

  • MKVtoMP4.bat
  • Movie.mp4

    └───────SubFolder
    - Movie.mkv

WANTED Result:
C:\
├───MainFolder

  • MKVtoMP4.bat

    └───────SubFolder
    - Movie.mkv
    - Movie.mp4

Read through some thread in Stackoverflow but did not find anything that could help out

0

There are 0 answers