# Deleting a windows file

**URL:** <https://forum.ansible.com/t/deleting-a-windows-file/25167>\
**Category:** Ansible Project\
**Tags:** windows\
**Created:** [August 2, 2017, 6:20pm UTC](https://forum.ansible.com/t/deleting-a-windows-file/25167 "2017-08-02T18:20:20Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![Chris13](https://avatars.discourse-cdn.com/v4/letter/c/c5a1d2/32.png) [@Chris13](https://forum.ansible.com/u/Chris13)\
**Post date:** [August 2, 2017, 6:20pm UTC](https://forum.ansible.com/t/deleting-a-windows-file/25167/1 "2017-08-02T18:20:20Z")

</div>

I would like to see if there is a similar command in windows to the wait\_for module. I’m deleting a file and would like the playbook to not copy over the new file until it’s complete. Perhaps there’s a different Windows module that can do this, but I didn’t see one in the list. Thanks.

---

<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:** [August 2, 2017, 11:45pm UTC](https://forum.ansible.com/t/deleting-a-windows-file/25167/2 "2017-08-02T23:45:20Z")

</div>

Hey Chris

There isn’t one in the main codebase right now but there is a PR that adds the module. You PR is [https://github.com/ansible/ansible/pull/26556](https://github.com/ansible/ansible/pull/26556) and if you do decide to test this out it would be great to share your results on that page. That being said the win\_file and win\_copy modules should be able to do what you are looking for. Without seeing your playbook and setup I can’t tell but when you delete a file with win\_file or copy a file with win\_copy it should only exit once the process is complete.

Thanks

Jordan

---

<div class="post-metadata">

**Author:** ![Chris13](https://avatars.discourse-cdn.com/v4/letter/c/c5a1d2/32.png) [@Chris13](https://forum.ansible.com/u/Chris13)\
**Post date:** [August 3, 2017, 4:20pm UTC](https://forum.ansible.com/t/deleting-a-windows-file/25167/3 "2017-08-03T16:20:20Z")

</div>

I can delete the file with win\_file. If it doesn’t move on to the next command before finishing then it should be fine. Thanks for the link.
