# how does one escape this line

**URL:** <https://forum.ansible.com/t/how-does-one-escape-this-line/24037>\
**Category:** Ansible Developer\
**Created:** [March 22, 2017, 6:16pm UTC](https://forum.ansible.com/t/how-does-one-escape-this-line/24037 "2017-03-22T18:16:59Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![Tony\_Walsh](https://avatars.discourse-cdn.com/v4/letter/t/e8c25b/32.png) [@Tony\_Walsh](https://forum.ansible.com/u/Tony_Walsh)\
**Post date:** [March 22, 2017, 6:16pm UTC](https://forum.ansible.com/t/how-does-one-escape-this-line/24037/1 "2017-03-22T18:16:59Z")

</div>

Folks

I would like to implement the following command via ansible’s win\_command module:

_%comspec% /k ““C:\Program Files (x86)\Microsoft Visual Studio 12.0\VC\vcvarsall.bat”” amd64_

I have tried everything I can think of, but the syntax checker always returns

_“changed”: false,_  
_“cmd”: “%%comspec%% /k "C:\Program Files (x86)\Microsoft Visual Studio 12.0\VC\vcvarsall.bat" amd64”,_  
_“failed”: true,_  
_“invocation”: {_  
_“module\_name”: “win\_command”_  
_},_  
_“msg”: “The system cannot find the file specified”,_  
_“rc”: 2_  
_}_

or some variation thereof. For example, I’ve tried single quotes around single percents with double quotes inside:

_win\_command: ‘\*\*%comspec% /k "C:\Program Files (x86)\Microsoft Visual Studio 12.0\VC\vcvarsall.bat" amd64’_

I’ve tried it with and without the double-backslashes. Pretty much every combination I can think of (except the right one!)

Anybody got an idea of how to escape this puppy so that the syntax checker doesn’t gak?

Thanks  
Tony

---

<div class="post-metadata">

**Author:** ![Tony\_Walsh](https://avatars.discourse-cdn.com/v4/letter/t/e8c25b/32.png) [@Tony\_Walsh](https://forum.ansible.com/u/Tony_Walsh)\
**Post date:** [March 22, 2017, 6:20pm UTC](https://forum.ansible.com/t/how-does-one-escape-this-line/24037/2 "2017-03-22T18:20:08Z")

</div>

got it:

- win\_command: ‘%comspec% /k “C:\Program Files (x86)\Microsoft Visual Studio 12.0\VC\vcvarsall.bat” amd64’

---

<div class="post-metadata">

**Author:** ![Tony\_Walsh](https://avatars.discourse-cdn.com/v4/letter/t/e8c25b/32.png) [@Tony\_Walsh](https://forum.ansible.com/u/Tony_Walsh)\
**Post date:** [March 22, 2017, 6:22pm UTC](https://forum.ansible.com/t/how-does-one-escape-this-line/24037/3 "2017-03-22T18:22:02Z")

</div>

Never mind…the syntax-checker passes but ansible still can’t find the file…sigh…

---

<div class="post-metadata">

**Author:** ![j.r.hawkesworth](https://avatars.discourse-cdn.com/v4/letter/j/a3d4f5/32.png) [@j.r.hawkesworth](https://forum.ansible.com/u/j.r.hawkesworth)\
**Post date:** [March 23, 2017, 5:10am UTC](https://forum.ansible.com/t/how-does-one-escape-this-line/24037/4 "2017-03-23T05:10:35Z")

</div>

That’s a tough one. There are lot of parsers to keep happy - python, yaml, jinja2 and powershell as well.

Just wondering if you could wrap the command line into another .bat or .ps1 file and then just run the wrapper and dodge a lot of the parsing perhaps?

Jon

---

<div class="post-metadata">

**Author:** ![Tony\_Walsh](https://avatars.discourse-cdn.com/v4/letter/t/e8c25b/32.png) [@Tony\_Walsh](https://forum.ansible.com/u/Tony_Walsh)\
**Post date:** [March 24, 2017, 1:49pm UTC](https://forum.ansible.com/t/how-does-one-escape-this-line/24037/5 "2017-03-24T13:49:42Z")

</div>

yeah, I thought of that, but my powershell scripting experience is minimal, i was hoping to be able to “escape” my way to an answer. Will try the powershell approach.

Thanks Jon!  
Tony
