# Issue while Passing path values from loop to win\_command

**URL:** <https://forum.ansible.com/t/issue-while-passing-path-values-from-loop-to-win-command/30836>\
**Category:** Ansible Project\
**Created:** [July 22, 2019, 12:47pm UTC](https://forum.ansible.com/t/issue-while-passing-path-values-from-loop-to-win-command/30836 "2019-07-22T12:47:09Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![Asha\_Omanakuttan](https://avatars.discourse-cdn.com/v4/letter/a/b9e5f3/32.png) [@Asha\_Omanakuttan](https://forum.ansible.com/u/Asha_Omanakuttan)\
**Post date:** [July 22, 2019, 12:47pm UTC](https://forum.ansible.com/t/issue-while-passing-path-values-from-loop-to-win-command/30836/1 "2019-07-22T12:47:09Z")

</div>

Due to backslash being added or removed win\_command is not working as expected. It works fine when I pass the path in a variable.

```auto
- name: List the user details
  win_command: '{{full_cmd}} {{cmd1}}'

```

Variables are as below:

```auto
full_cmd: some command
cmd1: Path="D:\Program Files\somepath"

```

cmd from Output:

```auto
"cmd": "some command Path=\"D:\\Program Files\\somepath\"",

```

But I want to pass it via a loop. Path is a list obtained via set\_fact and list. Here it doesn’t work as backslashes are not there as above.

```auto
win_command: '{{command}}"{{item}}" {{cmd2}}'   
with_items: "{{path}}"

```

```auto

```
