# win\_template Illegal characters in path

**URL:** <https://forum.ansible.com/t/win-template-illegal-characters-in-path/20413>\
**Category:** Ansible Project\
**Tags:** windows\
**Created:** [February 1, 2016, 11:38pm UTC](https://forum.ansible.com/t/win-template-illegal-characters-in-path/20413 "2016-02-01T23:38:04Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![Joe\_Levis](https://avatars.discourse-cdn.com/v4/letter/j/b9e5f3/32.png) [@Joe\_Levis](https://forum.ansible.com/u/Joe_Levis)\
**Post date:** [February 1, 2016, 11:38pm UTC](https://forum.ansible.com/t/win-template-illegal-characters-in-path/20413/1 "2016-02-01T23:38:04Z")

</div>

Not sure what I’m doing wrong here. I’ve tried all different styles of configuration with no success. I’m trying to templatize a config file on a Windows Server 2012 R2, but it’s throwing the below error:

**“failed”: true, “invocation”: {“module\_args”: {“dest”: “C:\temp\test.conf”, “src”: “templates/config.j2”}, “module\_name”: “win\_template”}, “msg”: “Illegal characters in path.”}**

**Playbook:**

---

<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:** [February 2, 2016, 2:52pm UTC](https://forum.ansible.com/t/win-template-illegal-characters-in-path/20413/2 "2016-02-02T14:52:26Z")

</div>

I’m guessing here that you are getting bitten by the \t part of c:\temp being interpreted as a tab character.

try

- name: Config file

win\_template: src=templates/config.j2 dest=‘C:\temp\test.conf’

or if you prefer double quotes:

- name: Config file

win\_template: src=templates/config.j2 dest=“C:\temp\test.conf”

(note the \ as windows path separator):

actually may need to be

- name: Config file

win\_template: “src=templates/config.j2 dest=C:\temp\test.conf”

Hope this helps,

Jon

---

<div class="post-metadata">

**Author:** ![Joe\_Levis](https://avatars.discourse-cdn.com/v4/letter/j/b9e5f3/32.png) [@Joe\_Levis](https://forum.ansible.com/u/Joe_Levis)\
**Post date:** [February 2, 2016, 4:27pm UTC](https://forum.ansible.com/t/win-template-illegal-characters-in-path/20413/3 "2016-02-02T16:27:19Z")

</div>

You were right Jon. I needed to escape the backslashes. This worked:

dest=“C:\temp\test.conf”

Thanks!

-Joe
