I'm trying to run this command while embedding the env.JOB_BASE_NAME variable like so:
bat '"C:\\Program Files (x86)\\Microsoft Visual Studio\\2017\\BuildTools\\MSBuild\\15.0\\Bin\\amd64\\MSBuild.exe" "C:\\jenkins\\workspace\\${env.JOB_BASE_NAME}\\MySolution.sln"'
I tried the answer suggested on this question but that solution doesn't work for me. If I remove the single quotes as was suggested in the other answer, I get this error:
'C:\Program' is not recognized as an internal or external command, program or batch file.
Presumably because of the space between 'Program' and 'Files'.
I've tried wrapping it in triple double quotes, and various other solutions, with no luck. What is the proper way to do this?