# How to force win\_unzip to overwrite a existing file?

**URL:** <https://forum.ansible.com/t/how-to-force-win-unzip-to-overwrite-a-existing-file/26514>\
**Category:** Ansible Project\
**Created:** [January 18, 2018, 7:42pm UTC](https://forum.ansible.com/t/how-to-force-win-unzip-to-overwrite-a-existing-file/26514 "2018-01-18T19:42:04Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![Daniel\_Bernardo](https://avatars.discourse-cdn.com/v4/letter/d/a9adbd/32.png) [@Daniel\_Bernardo](https://forum.ansible.com/u/Daniel_Bernardo)\
**Post date:** [January 18, 2018, 7:42pm UTC](https://forum.ansible.com/t/how-to-force-win-unzip-to-overwrite-a-existing-file/26514/1 "2018-01-18T19:42:04Z")

</div>

I’m extrating a zip file on a folder, like to do a IIS deploy using win\_unzip, but files that alredy exists were no updated.

I didnt found nothing about =/

[http://docs.ansible.com/ansible/latest/win\_unzip\_module.html](http://docs.ansible.com/ansible/latest/win_unzip_module.html)

---

<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:** [January 18, 2018, 11:49pm UTC](https://forum.ansible.com/t/how-to-force-win-unzip-to-overwrite-a-existing-file/26514/2 "2018-01-18T23:49:44Z")

</div>

This is definitely not the case for me, looking at the code there is no checksum verification of files and it will always overwrite the existing file if it already exists. The only exception to this rule is if you use the creates argument where it won’t even run any extraction if the path already exists.

Might be best to check that the contents of the 2 zip files are either the same or different as 2.3 to 2.5 (devel) all overwrite on extraction.

Thanks

Jordan

---

<div class="post-metadata">

**Author:** ![j.r.hawkesworth](https://avatars.discourse-cdn.com/v4/letter/j/a3d4f5/32.png) [@j.r.hawkesworth](https://forum.ansible.com/u/j.r.hawkesworth)\
**Post date:** [January 23, 2018, 7:54am UTC](https://forum.ansible.com/t/how-to-force-win-unzip-to-overwrite-a-existing-file/26514/3 "2018-01-23T07:54:58Z")

</div>

If it makes sense for what you are doing, you can allways make sure that the zip is removed by running a win file state: absent first, like this.

- name: ensure old zip is removed  
win\_file:  
state: absent  
path: C:\path\to\zipfile.zip
