Allow spaces in command

I have been using this set of commands to make an archive of selected files. It works OK when the selected files do not have a space in the names. However, if it does find a space in one of the names, it displays an error. How could I modify this command so that it allows for spaces in the filenames? Thanks

@set names={file|Name|{file$|noext}}
@set name={dlgstringS|Enter Archive Name}
Copy HERE ARCHIVE=.rar,keepfolder CREATEFOLDER="{date|yyMMdd}{time|HHmm}_{$names}_{$name}"

Use double quotes for file names.
"file$"

Hi, thanks for the reply. Do you mean like this?

@set names={file|Name|{"file$"|noext}}
@set name={dlgstringS|Enter Archive Name}
Copy HERE ARCHIVE=.rar,keepfolder CREATEFOLDER="{date|yyMMdd}{time|HHmm}_{$names}_{$name}"

I tried that but it also produces an error.

"{$name}"

I had tried wrapping that plus other things in quotes but have not had any luck. Do they need to be escaped? Thanks

@nofilenamequoting
@set names={file|Name|{file$|noext}}
@set name={dlgstringS|Enter Archive Name}
Copy HERE ARCHIVE=.rar,keepfolder CREATEFOLDER="{date|yyMMdd}{time|HHmm}_{$names}_{$name}"

is ok

I see... that's it. Thanks!