# win\_lineinfile invalid Path argument

**URL:** <https://forum.ansible.com/t/win-lineinfile-invalid-path-argument/29925>\
**Category:** Ansible Project\
**Tags:** windows\
**Created:** [March 20, 2019, 3:49pm UTC](https://forum.ansible.com/t/win-lineinfile-invalid-path-argument/29925 "2019-03-20T15:49:14Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![bit\_conneeect](https://avatars.discourse-cdn.com/v4/letter/b/3d9bf3/32.png) [@bit\_conneeect](https://forum.ansible.com/u/bit_conneeect)\
**Post date:** [March 20, 2019, 3:49pm UTC](https://forum.ansible.com/t/win-lineinfile-invalid-path-argument/29925/1 "2019-03-20T15:49:14Z")

</div>

Hello everyone,

I am trying to change specific lines of an xml file which is located on J:\ on a windows machine.  
Due to the fact that the win\_xml module is only able to add but not override strings, I chose the win\_linefile module to do so.  
This is the task I am deploying:

- name: overwrite xml  
win\_lineinfile:  
path: J:\settings\_test.xml  
regexp: ‘\</url\>\s\*\s\*true\</enabled\>\s\*\</snapshots\>’  
line: ‘\n’

The error I get is: msg": “Get-AnsibleParam: Parameter ‘path’ has an invalid path ‘J:\settings\_test.xml’ specified.”  
I allready tried to use / instead of , use single quotes and also double quotes + escaping. But nothing worked for me.  
Is there anything I am missing? Thanks in advance, I appreciate any help!

Kind Regards

---

<div class="post-metadata">

**Author:** ![CORLEONE](https://avatars.discourse-cdn.com/v4/letter/c/9f8e36/32.png) [@CORLEONE](https://forum.ansible.com/u/CORLEONE)\
**Post date:** [March 20, 2019, 5:01pm UTC](https://forum.ansible.com/t/win-lineinfile-invalid-path-argument/29925/2 "2019-03-20T17:01:52Z")

</div>

Hello, did u check ur host?..  
Also u can check if path is configured correctly but putting a txt or conf file in the same directory as ur xml one(since i worked with txt nd conf file only using lineinfile )and running the same task on that file.If that works fine it means its failing on xml…some people complained that lineinfile somehow changed the file format…U can try using template module…  
hope that might help.  
Regards
