How to handle dialog codes in combination with paths

When I am using this command (in a batch function button):

@set dest = {dlgfolder|Select destination|M:\VIDEO\|expand}
mkvmerge.exe -o {$dest}\{file} --no-subtitles {file}
pause

I get this error:

mkvmerge v67.0.0 ('Under Stars') 64-bit
'House (2004) - S01E13 - Cursed [Bluray-1080p][8bit][x264][DTS 6.0].mkv': Using the demultiplexer for the format 'Matroska'.
'House (2004) - S01E13 - Cursed [Bluray-1080p][8bit][x264][DTS 6.0].mkv' track 0: Using the output module for the format 'AVC/H.264'.
'House (2004) - S01E13 - Cursed [Bluray-1080p][8bit][x264][DTS 6.0].mkv' track 1: Using the output module for the format 'DTS'.
Error: The file 'M:\VIDEO\TV SHOWS\House M.D\Season 01"\House (2004) - S01E13 - Cursed [Bluray-1080p][8bit][x264][DTS 6.0].mkv' could not be opened for writing: open file error.

I think the problem is the quotation mark (Season 01"\) (see the last line in the error message).

Is there some way to combine {$dest} with {file} so that the output for MKVmerge is M:\VIDEO\TV SHOWS\House M.D\Season 01\House (2004) - S01E13 - Cursed [Bluray-1080p][8bit][x264][DTS 6.0].mkv

Use @nofilenamequoting and set the quotes manually.

Thanks @lxp Where should I put this?

I tried like this, but I could not figure it out:

@nofilenamequoting
@set dest = {dlgfolder}
mkvmerge.exe -o "{$dest}"{file$} --no-subtitles {file$}
pause

Then I get Error: No source files were given. Not sure why it does not read {file$}.

Try

@nofilenamequoting
@set dest = {dlgfolder}
mkvmerge.exe -o "{$dest}{file$}" --no-subtitles "{file$}"
pause

Thanks!

I was so close, yet no cigar :joy: