# List folder/files on windows

**URL:** <https://forum.ansible.com/t/list-folder-files-on-windows/34554>\
**Category:** Ansible Project\
**Tags:** windows\
**Created:** [February 2, 2021, 11:13am UTC](https://forum.ansible.com/t/list-folder-files-on-windows/34554 "2021-02-02T11:13:36Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![Deepak\_Gowda](https://avatars.discourse-cdn.com/v4/letter/d/f19dbf/32.png) [@Deepak\_Gowda](https://forum.ansible.com/u/Deepak_Gowda)\
**Post date:** [February 2, 2021, 11:13am UTC](https://forum.ansible.com/t/list-folder-files-on-windows/34554/1 "2021-02-02T11:13:36Z")

</div>

HI All,

I have a list of files in C:\Users\xxxuser\Downloads\ ,I am trying to find out if i can pull the list of files/folders present in windows on the ansible node.

i have the below playbook which doesnt give any error nd doesn’t give me a list,

- hosts: windows

tasks:

- name: Find Files in Path

win\_find:

paths: C:\Users\xxxuser\Downloads  
age: 2h

Thanks  
Deepak

---

<div class="post-metadata">

**Author:** ![racke](https://sea1.discourse-cdn.com/ansible/user_avatar/forum.ansible.com/racke/32/4767_2.png) [@racke](https://forum.ansible.com/u/racke)\
**Post date:** [February 2, 2021, 11:42am UTC](https://forum.ansible.com/t/list-folder-files-on-windows/34554/2 "2021-02-02T11:42:36Z")

</div>

> HI All,
> 
> I have a list of files in C:\Users\xxxuser\Downloads\ ,I am trying to find out if i can pull the list of files/folders  
> present in windows on the ansible node.
> 
> i have the below playbook which doesnt give any error nd doesn't give me a list,
> 
> - hosts: windows
> 
> tasks:
> 
> - name: Find Files in Path
> 
> ```
> win\_find:
> 
> paths: C:\\Users\\xxxuser\\Downloads\\
> age: 2h
> 
> ```

Hello Deepak,

I think you need to register the results to see the list of files:

- name: Find Files in Path  
&nbsp;&nbsp;win\_find:  
&nbsp;&nbsp;&nbsp;&nbsp;paths: C:\Users\xxxuser\Downloads\  
&nbsp;&nbsp;&nbsp;&nbsp;age: 2h  
&nbsp;&nbsp;register: xxx\_downloads

- debug:  
&nbsp;&nbsp;&nbsp;&nbsp;msg: "{{ xxx\_downloads.files }}"

Regards  
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Racke
