Is there anything you could do to optimize this script? It already works as-is, and I…
- User
Is there anything you could do to optimize this script? It already works as-is, and I don't want error logging added. Other than that, you're free to do whatever you please:
@echo off setlocal enabledelayedexpansion
REM =========================== REM Configuration REM ===========================
REM Source directory (directory where the script resides) set "SRC_DIR=%~dp0"
REM Destination directory set "DEST_DIR=D:\Video\MKVConvert"
REM Path to mkvmerge.exe set "MKVMERGE=C:\Program Files\MKVToolNix\mkvmerge.exe"
REM =========================== REM Setup REM ===========================
REM Create destination directory if it doesn't exist if not exist "%DEST_DIR%" ( mkdir "%DEST_DIR%" )
REM =========================== REM Processing Loop REM ===========================
REM Iterate over each MKV file in the source directory for %%a in ("%SRC_DIR%*.mkv") do ( echo Processing: %%~nxa
code"%MKVMERGE%" ^ --ui-language en --priority highest ^ --video-tracks 0 --audio-tracks 1 --subtitle-tracks 2 ^ --no-attachments --no-global-tags --no-track-tags --no-chapters ^ --language 0:en --track-name 0: --default-track-flag 0:yes ^ --language 1:en --track-name 1: --default-track-flag 1:yes ^ --sub-charset 2:UTF-8 --language 2:en --track-name 2: ^ --default-track-flag 2:yes ^ --title "" --track-order 0:0,0:1,0:2 ^ --output "%DEST_DIR%\%%~nxa" ^ "%%~fa" REM Check for errors during mkvmerge execution if errorlevel 1 ( echo Error processing %%~nxa ) else ( echo Successfully processed %%~nxa ) echo -------------------------------)
pause
- Assistant