Try this one:
Join files with MP4Box [2022-04-21].kmmacros (6.9 KB)
I changed the way the output path is constructed, which allowed for proper quoting — as @Nige_S had suggested:
Tested with folder names like this: un"titled 'folder
Lesson learned (again): Never be sloppy with path quoting. It will hit you back, even if it’s 4 years later