Call .exe from batch file with variable path containing spaces
<p>I want to launch a windows executable from a batch file where the path to the executable is stored in a variable.</p>

<pre class="lang-sh prettyprint-override"><code>@echo off

set qtpath=C:\Program Files\Qt\5.7\mingw53_32\bin
set execpath=%qtpath%\windeployqt.exe

echo %execpath%

%execpath% --someparams
</code></pre>

<p>Unfortunately executing my script throws an error:</p>

<pre><code>'C:\Program' is not recognized as an internal or external command, operable program or batch file.
</code></pre>

<p>Looks like somehow the string gets terminated at the space in <code>Program Files</code>.</p>