:: %6 = "%_flag_1%" = mkv flag to process and output file :: %5 = "%_flag_0%" = mkv flag for process the first subtitle :: input in loop :: %4 = "%_mkv%" = the full path to the mkvmerge executable :: %3 = "%%~i" = the full path to the current mp4 file :: %2 = "%%~ni" = the name without extension for the current mp4 :: call %:ˆ) "Season1" "title1" "C:\Users\Answer42\Videos\SU-2022\Season1\title1.mp4" "C:\Program Files\MKVToolNix\mkvmerge.exe" "-default-language en -language 0:en" "-priority higher -flush-on-close -disable-track-statistics-tags -o" "*.srt" When calling a function in bat, it is necessary to pass the variables/string (in arguments) so that it is possible to make use of them: :: call :label/function and passing all arguments |find/v /i "\subs\"ĭir /a:d /b | findstr /ei Season.* |find/v /i "\subs\"ĭir /a:d /b | findstr /ei Season |find/v /i "\subs\"ĭir /a:d /b | findstr /ei Season. The Findstr will filter the subfolders and allow it to run on all that match your folder name layout, below some options to check which one applies best to your scenario dir /a:d /b | findstr /ei Season. Call a function already composing the arguments to be used in it to process the mp4 when the first subtitle\file.srt is found and exit the function immediately. Save the mkv /flags you need and the full path of mkv executable too, and use inside the function ( :label)ĥ. If in that folder there is an any/more.mp4, then this time get their path tooĤ. Use a for /f loop to get the full path of each folder SeasonX\ģ. Save this bat at base/root (1 level above SeasonX\ folders:Ģ. If "%~1" = "" (endlocal
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |