Windows: syntax for Run path with spaces

What is the syntax to use in the yaml file to execute a batch file with spaces in the path? I’ve tried single and double quotes and doubling up the backslashes, but still haven’t landed a working combination.

Example from

Run C:\Program Files (x86)\Microsoft Visual Studio\2019\Enterprise\Common7\tools\vcvars64.bat

C:\Program Files (x86)\Microsoft Visual Studio\2019\Enterprise\Common7\tools\vcvars64.bat

shell: C:\windows\system32\cmd.exe /D /E:ON /V:OFF /S /C “CALL “{0}””

‘C:\Program’ is not recognized as an internal or external command,

yaml excerpt:

    - uses: actions/checkout@v1
    - name: init vs studio
      run: 'C:\\Program Files (x86)\\Microsoft Visual Studio\\2019\\Enterprise\\Common7\\tools\\vcvars64.bat'
    - name: configure
      run: configure


call “<path>”

single backslashes

Thanks for the suggestion, but no go.

  • Call with single backslashes yields “yaml: line 13: found unknown escape character” 

  • Call with double backslash is “Your workflow file was invalid: .github/workflows/ccpp.yml (Line: 13, Col: 7): Unexpected value ‘call’”

  • and finally run: call “C:\Program Files (x86)…{snip}…\vcvars64.bat” yields:

    shell: C:\windows\system32\cmd.exe /D /E:ON /V:OFF /S /C “CALL “{0}””
    ‘“C:\Program Files (x86)\Microsoft Visual Studio\2019\Enterprise\Common7\tools\vcvars64.bat”’ is not recognized as an internal or external command, operable program or batch file.


Sorry, didn’t actually try it, but I’ve had times where

run: <statement>

didn’t work, but

run: |



The example I knew existed was:

run: |
    call "C:\Program Files (x86)\Microsoft Visual Studio\${{ matrix.vs }}\Enterprise\VC\Auxiliary\Build\vcvars64.bat"
win32/configure.bat --disable-install-doc --without-ext=+,dbm,gdbm --enable-bundled-libffi --with-opt-dir=C:/vcpkg/installed/x64-windows

See: Ruby CI windows.yml

making progress. Key things:

“run: |” creates a script.

run: |
    echo 'foo'
    echo 'bar

 .cmd file:

echo 'foo'
echo 'bar'

Foreward slashes work (but not always):

pushd "C:/Program Files (x86)/Microsoft Visual Studio"
:: Uncomment next line to find all bats in this tree
rem dir /s/b *.bat
"C:/Program Files (x86)/Microsoft Visual Studio/2019/Enterprise/VC/Auxiliary/Build/vcvars64.bat"
1 Like

On Github Actions, using shell: pwsh (PowerShell 6) and running the scripts like the following works both on Windows and Linux (using ' around the command and escaping " using \:

run: julia -e 'using Pkg; Pkg.add(PackageSpec(url = \"\", rev = \"multios\"));'

shell: pwsh

So the only difference with bash is the need for explicit escaping of " using \

run: julia -e 'using Pkg; Pkg.add(PackageSpec(url = "", rev = "multios"));'

shell: bash