Combine mkv's in Windows (automated, not using a GUI)

batch-file, mkv, windows

Solution

I can give you an example:

@echo off &setlocal enabledelayedexpansion
cd /d "%sourcefolder%"
set "line="
for %%a in (*.mkv) do set line=!line! +"%%~a"
mkvmerge -o "output.mkv" %line:~2%

Problem

From time to time I receive several mkv's from a server I have. These mkv's are all part of the same recording, but they come in 1 minute chunks, and I don't want to have to take the time to stitch them together manually each time. Can this be done via an automated process in Windows? EDIT: See my answer below for the solution that worked for me. The post by Endoro also looks promising.

Original source