tag:help.appveyor.com,2012-11-13:/discussions/problems/2863-how-to-escape-spaces-in-a-commandAppVeyor: Discussion 2018-08-25T02:27:16Ztag:help.appveyor.com,2012-11-13:Comment/377305672015-08-22T20:34:38Z2015-08-22T20:34:39ZHow to escape spaces in a command?<div><p>I have these variables set:</p>
<pre>
<code>environment:
SDK_ROOT: "C:\\Program Files\\Microsoft SDKs\\Windows"
SDK_VERSION: "v7.1"</code>
</pre>
<p>and I'm trying to run these commands:</p>
<pre>
<code>init:
- "%SDK_ROOT%\\%SDK_VERSION%\\Setup\\WindowsSdkVer.exe -q -version:%SDK_VERSION%"
- "%SDK_ROOT%\\%SDK_VERSION%\\Bin\\SetEnv.cmd /x64 /release"</code>
</pre>
<p>The spaces in the <code>SDK_ROOT</code> variable are
problematic. I've tried escaping with <code>\</code>,
<code>^</code>, <code>"</code>, double-slashes, double-quotes... no
luck.</p>
<p>How could I escape the spaces in the path to run these two
commands?</p>
<p>Thanks for your time.</p></div>eliteraspberriestag:help.appveyor.com,2012-11-13:Comment/377305672015-08-22T21:54:00Z2015-08-22T21:54:01ZHow to escape spaces in a command?<div><p>Using single quotes worked.</p></div>eliteraspberriestag:help.appveyor.com,2012-11-13:Comment/377305672018-03-05T15:49:19Z2018-03-05T15:49:19ZHow to escape spaces in a command?<div><p>Can you expand on where the single quotes were placed?</p>
<p>Im having a nightmare trying to get secure-file to work when the file in question has a space in its name</p>
<p>EAZFUSCATOR_LICENSE_NAME_1: 'License Copy'</p>
<ul>
<li>tools\secure-file -decrypt 'tools\%EAZFUSCATOR_LICENSE_NAME_1%.txt.enc' -out '=tools\%EAZFUSCATOR_LICENSE_NAME_1%.txt' -secret %PASSWORD%</li>
</ul></div>matt_mckinstrytag:help.appveyor.com,2012-11-13:Comment/377305672018-03-07T03:04:28Z2018-03-07T03:04:28ZHow to escape spaces in a command?<div><p>1) try removing quotes in environment variable definition:</p>
<pre>
<code>EAZFUSCATOR_LICENSE_NAME_1: License Copy</code>
</pre>
<p>2) Replace single quotes with double quotes in the command:</p>
<pre>
<code>- 'tools\secure-file -decrypt "tools\%EAZFUSCATOR_LICENSE_NAME_1%.txt.enc" -out "tools\%EAZFUSCATOR_LICENSE_NAME_1%.txt" -secret %PASSWORD%'</code>
</pre></div>Feodor Fitsner