# Weird Windows Path Problem

**URL:** <https://forum.ansible.com/t/weird-windows-path-problem/30636>\
**Category:** Ansible Project\
**Tags:** windows, ubuntu\
**Created:** [June 23, 2019, 2:05pm UTC](https://forum.ansible.com/t/weird-windows-path-problem/30636 "2019-06-23T14:05:29Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![dmartin](https://avatars.discourse-cdn.com/v4/letter/d/c4cdca/32.png) [@dmartin](https://forum.ansible.com/u/dmartin)\
**Post date:** [June 23, 2019, 2:05pm UTC](https://forum.ansible.com/t/weird-windows-path-problem/30636/1 "2019-06-23T14:05:29Z")

</div>

Hi, I’m using Ansible 2.8 on Ubuntu and I’m trying to make a directory to a windows box.

But wait! I hear you say, what about [https://docs.ansible.com/ansible/latest/user\_guide/windows\_usage.html#path-formatting-for-windows](https://docs.ansible.com/ansible/latest/user_guide/windows_usage.html#path-formatting-for-windows) ?  
Read it.

If I use an unquoted or single quoted string, like so:

- win\_file:  
path: C:\foo

I get

“path C:\foo will not be created”

If I use a double quoted string, like so:

- win\_file:

path: “C:\foo”

I get

“Get-AnsibleParam: Parameter ‘path’ has an invalid path ‘C:\foo’ specified.”

Help!

---

<div class="post-metadata">

**Author:** ![jborean](https://sea1.discourse-cdn.com/ansible/user_avatar/forum.ansible.com/jborean/32/1525_2.png) [@jborean](https://forum.ansible.com/u/jborean)\
**Post date:** [June 23, 2019, 7:29pm UTC](https://forum.ansible.com/t/weird-windows-path-problem/30636/2 "2019-06-23T19:29:26Z")

</div>

You had it right the first time, the trouble is the default value for state in win\_file if the path does not exist is ‘file’. For backwards compatibility state=file will not create a file which makes it a bit useless really but that’s just how it is. You want to add ‘state: directory’ if you wanted to create a directory at C:\foo.

Thanks

Jordan
