# Why a progress over when ansible exec all tasks on windows?

**URL:** <https://forum.ansible.com/t/why-a-progress-over-when-ansible-exec-all-tasks-on-windows/22177>\
**Category:** Ansible Project\
**Tags:** windows\
**Created:** [August 1, 2016, 8:30am UTC](https://forum.ansible.com/t/why-a-progress-over-when-ansible-exec-all-tasks-on-windows/22177 "2016-08-01T08:30:10Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![fcxjluo](https://avatars.discourse-cdn.com/v4/letter/f/3e96dc/32.png) [@fcxjluo](https://forum.ansible.com/u/fcxjluo)\
**Post date:** [August 1, 2016, 8:30am UTC](https://forum.ansible.com/t/why-a-progress-over-when-ansible-exec-all-tasks-on-windows/22177/1 "2016-08-01T08:30:10Z")

</div>

ansible 2.2.0  
I use raw module to run a bat,and the bat exec a jar,the jar will always run because it’s a monitoring program。But when ansible exec the taks over,the jar will also over,why?

---

<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:** [August 2, 2016, 5:08am UTC](https://forum.ansible.com/t/why-a-progress-over-when-ansible-exec-all-tasks-on-windows/22177/2 "2016-08-02T05:08:27Z")

</div>

I think that is just the way windows remoting works - when you log out it kills any processes you have created (similar to when you log out of a remote desktop window, rather than just disconnect).

It is definitely possible to get your java jar program to run if you set it up to run as a windows service.

There is probably more than one way to do this but one way is to install nssm - downloadable from here: [https://nssm.cc/download](https://nssm.cc/download) and then use win\_nssm module to set up your java program to run as a service. Depending on what your java jar does it may need to run as a specific user.

I hope this helps.

Jon
