How can I stop this batch from working with subfolders.
Posted: 28 Mar 2020 22:30
Hello, I use the batch file below to remove subtitles from mkv video files. It works really well except it checks all subfolders in "F:\Films.
I don't want to move the subfolders and as there are quite a few,it takes a while to run. So how can I stop this batch from working with the subfolders.
Thanks for your help
I don't want to move the subfolders and as there are quite a few,it takes a while to run. So how can I stop this batch from working with the subfolders.
Thanks for your help
Code: Select all
@echo off
cls
set rootfolder=F:\Films
echo Enumerating all MKVs under %rootfolder%
echo.
for /r %rootfolder% %%a in (*.mkv) do (
for /f %%b in ('mkvmerge -i "%%a" ^| find /c /i "subtitles"') do (
if [%%b]==[0] (
echo "%%a" has no subtitles
) else (
echo.
echo "%%a" has subtitles
mkvmerge -q -o "%%~dpna (No Subs)%%~xa" -S "%%a"
if errorlevel 1 (
echo Warnings/errors generated during remuxing, original file not deleted
)
echo.
)
)
)
Pause