# win\_shell hangs

**URL:** <https://forum.ansible.com/t/win-shell-hangs/23770>\
**Category:** Ansible Project\
**Tags:** windows\
**Created:** [February 20, 2017, 1:40pm UTC](https://forum.ansible.com/t/win-shell-hangs/23770 "2017-02-20T13:40:09Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![Hamdi\_Ben\_Zekri](https://avatars.discourse-cdn.com/v4/letter/h/3e96dc/32.png) [@Hamdi\_Ben\_Zekri](https://forum.ansible.com/u/Hamdi_Ben_Zekri)\
**Post date:** [February 20, 2017, 1:40pm UTC](https://forum.ansible.com/t/win-shell-hangs/23770/1 "2017-02-20T13:40:09Z")

</div>

hello,  
I tried to execute a bash script ( the script is inside the remote windows server)  
the bash script was executed but the win\_shell task hangs.  
win\_shell: chdir=“C:\someApp\bin” ./start.bat

---

<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:** [February 28, 2017, 1:39pm UTC](https://forum.ansible.com/t/win-shell-hangs/23770/2 "2017-02-28T13:39:54Z")

</div>

Not a lot of information to go on here, but it looks like you might need to change syntax, looking at the examples here:  
[https://docs.ansible.com/ansible/win\_shell\_module.html](https://docs.ansible.com/ansible/win_shell_module.html)

try something like this in your playbook

`  
win\_shell: start.bat  
args:  
chdir: C:\someApp\bin

`

---

<div class="post-metadata">

**Author:** ![Hamdi\_Ben\_Zekri](https://avatars.discourse-cdn.com/v4/letter/h/3e96dc/32.png) [@Hamdi\_Ben\_Zekri](https://forum.ansible.com/u/Hamdi_Ben_Zekri)\
**Post date:** [March 2, 2017, 3:33pm UTC](https://forum.ansible.com/t/win-shell-hangs/23770/3 "2017-03-02T15:33:50Z")

</div>

Hello,  
thank you for the reply,

the issue is within the “someApp”, even if I start the app manually a cmd windows pops up to start it and when I run the C:\someApp\bin\stop.bat the App stops however the opened cmd windows never closes and that leads the powershell to keep the session alive on until the closure of the cmd windows .

My solution to find the process and kill it after stopping the App.

---

<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:** [March 3, 2017, 5:29pm UTC](https://forum.ansible.com/t/win-shell-hangs/23770/4 "2017-03-03T17:29:44Z")

</div>

Many apps with msi installers have a quiet mode for unattended installations. Might be worth checking to see if your app has a silent mode. Often there is a /qn option you can pass to the installer program.

Hope this helps,

Jon

---

<div class="post-metadata">

**Author:** ![Hamdi\_Ben\_Zekri](https://avatars.discourse-cdn.com/v4/letter/h/3e96dc/32.png) [@Hamdi\_Ben\_Zekri](https://forum.ansible.com/u/Hamdi_Ben_Zekri)\
**Post date:** [March 4, 2017, 7:04am UTC](https://forum.ansible.com/t/win-shell-hangs/23770/5 "2017-03-04T07:04:01Z")

</div>

The app is embededd inside an osgi container (karaf), there is no installer,the app is started by just executing the karaf start script.

Thx
