One possible solution is to loop through all of the files, and perform a simple binary switch either capturing the filename, or operating on the previously captured filename and the current file:
@echo off
setlocal enabledelayedexpansion enableextensions
set _last=
for %%a in (*.mp4) do (
if "!_last!" == "" (
set _last=%%a
) else (
echo merging "!_last!" and "%%a" to "%%a_combined.mp4"
echo file '!_last!'>simple_list.txt
echo file '%%a'>>simple_list.txt
rem Obviously, change this depending on how you want to invoke ffmpeg
ffmpeg -f concat -safe 0 -i simple_list.txt -c copy "%%a_combined.mp4"
del simple_list.txt
set _last=
)
)
if not "!_last!" == "" (
echo !_last! was unprocessed!
)
While this works, I'd highly recommend you consider approaching this task with something like Python. For instance, if you wanted to process ten files in a batch, it'd absolutely be possible in a batch file, but almost trivial in a Python script. Or, if you want to combine, say "10 minutes" of videos to one file, it's possible in Python, but nearly impossible in a batch file.