Save the following as something like DelMKVSubs.bat in the same directory mkvmerge.exe is in, edit the rootfolder variable as per your requirements and run the batch file:
echo Enumerating all MKVs under %rootfolder%
for /r %rootfolder% %%a in (*.mkv) do (
for /f %%b in ('mkvmerge -i "%%a" ^| find /c /i "subtitles"') do (
if [%%b]== (
echo "%%a" has no subtitles
) else (
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
) else (
del /f "%%a"
echo Successfully remuxed to "%%~dpna (No Subs)%%~xa", original file deleted
The batch file should be easy enough to understand, but here's an overview nevertheless:
for /r to recursively search
%rootfolder% for all MKVs
It then runs
mkvmerge -i on each MKV to check whether a subtitle track exists
If the MKV does contain subtitle tracks, it runs
mkvmerge -S to remux the file while skipping all such tracks
Finally it checks the exit code of mkvmerge and if this (i.e.
errorlevel) is 0 indicating success with no warnings/errors, it deletes the original file
For more see the mkvmerge documentation and also
if /? etc. at the command prompt.