Batch merging videos: Video from folder A and Audio from folder B

Hi everybody, I searched this forum and found only one post from 2023 so I’m hoping since then there’s a way to easily do this.

I have two folders of MKV file of the same videos in Folders A and B. I would like to keep just the videos from folder A (which has better picture quality) and combine them with the audio and subtitles from folder B.

I can do it one by one through the GUI, but is there a way to do this on Windows with one of the third party tools? I looked at them, but I didn’t see anything describing what I’m trying to do so I’m not sure if there is or isn’t a way to do this.

Thank you.