CD "C:\Input"
for %%a in ("*.*") do "C:\ffmpeg.exe" -i %%a -map 0:v -map 0:a:0 -map 0:s -c:v copy -c:a ac3 -b:a 640K "C:\Out\%%~na.mkv"
pause
if there is no space this script works fine, but if there is a space in file name, the script reads only the first word of the file and throws an error. i tried to add a double quote first %%a. but then the script does not even run.
here is an example file name:
[TEST] ABC test - 99