Como não tenho o ffmpeg instalado neste pc, não foi testado:
:: Q:\Test18\SU_1332169.cmd
@Echo off
Set "BaseDir=c:\myfolder"
Set "OutMp4=%BaseDir%\Output.mp4"
Set "FfmpegCue=%Temp%\Ffmpeg.Cue"
:: gather files but exclude evt. present output file
( For /f "Delims=" %%A in (
'Dir /B/S/A-D/ON "%BaseDir%\*.mp4" 2^>NUL ^|findstr /VLI "%OutMp4%" '
) Do Echo=%%A
) > "%FfmpegCue%"
:: Just to show what's in the cue file:
more "%FfmpegCue%"
Pause
:: Do the concat
ffmpeg.exe -f concat -i "%FfmpegCue%" -c copy "%OutMp4%" && (
Echo Successfully created "%OutMp4%"
choice /M "Delete %FfmegCue% "
If not Errorlevel 2 Del "%FfmegCue%"
) || (echo ffmpeg exited with error)