How to escape spaces in a command?

eliteraspberries's Avatar


22 Aug, 2015 08:34 PM

I have these variables set:

  SDK_ROOT: "C:\\Program Files\\Microsoft SDKs\\Windows"
  SDK_VERSION: "v7.1"

and I'm trying to run these commands:

  - "%SDK_ROOT%\\%SDK_VERSION%\\Setup\\WindowsSdkVer.exe -q -version:%SDK_VERSION%"
  - "%SDK_ROOT%\\%SDK_VERSION%\\Bin\\SetEnv.cmd /x64 /release"

The spaces in the SDK_ROOT variable are problematic. I've tried escaping with \, ^, ", double-slashes, double-quotes... no luck.

How could I escape the spaces in the path to run these two commands?

Thanks for your time.

  1. 1 Posted by eliteraspberrie... on 22 Aug, 2015 09:54 PM

    eliteraspberries's Avatar

    Using single quotes worked.

  2. 2 Posted by matt_mckinstry on 05 Mar, 2018 03:49 PM

    matt_mckinstry's Avatar

    Can you expand on where the single quotes were placed?

    Im having a nightmare trying to get secure-file to work when the file in question has a space in its name


    - tools\secure-file -decrypt 'tools\%EAZFUSCATOR_LICENSE_NAME_1%.txt.enc' -out '=tools\%EAZFUSCATOR_LICENSE_NAME_1%.txt' -secret %PASSWORD%

  3. Support Staff 3 Posted by Feodor Fitsner on 07 Mar, 2018 03:04 AM

    Feodor Fitsner's Avatar

    1) try removing quotes in environment variable definition:


    2) Replace single quotes with double quotes in the command:

    - 'tools\secure-file -decrypt "tools\%EAZFUSCATOR_LICENSE_NAME_1%.txt.enc" -out "tools\%EAZFUSCATOR_LICENSE_NAME_1%.txt" -secret %PASSWORD%'
  4. Ilya Finkelshteyn closed this discussion on 25 Aug, 2018 02:27 AM.

Comments are currently closed for this discussion. You can start a new one.

Keyboard shortcuts


? Show this help
ESC Blurs the current field

Comment Form

r Focus the comment reply box
^ + ↩ Submit the comment

You can use Command ⌘ instead of Control ^ on Mac