# How to Run program as an administrator

**URL:** <https://forum.ansible.com/t/how-to-run-program-as-an-administrator/34640>\
**Category:** Ansible Project\
**Created:** [February 18, 2021, 8:33am UTC](https://forum.ansible.com/t/how-to-run-program-as-an-administrator/34640 "2021-02-18T08:33:03Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![sd1](https://avatars.discourse-cdn.com/v4/letter/s/7ea924/32.png) [@sd1](https://forum.ansible.com/u/sd1)\
**Post date:** [February 18, 2021, 8:33am UTC](https://forum.ansible.com/t/how-to-run-program-as-an-administrator/34640/1 "2021-02-18T08:33:03Z")

</div>

I am trying to run a software via win\_package module. But that software requires running as administrator which causes my script stuck at one position. How to run it as administrator. I am running trough a user which a member of admin group. here is my code

- name: installing Devexpress  
hosts: win  
gather\_facts: yes  
become\_method: runas

tasks:

- name: installing DevExpress13  
win\_package:  
path: D:\Soft\DevExpress13.exe  
arguments: /S /VERYSILENT  
state: present

---

<div class="post-metadata">

**Author:** ![Dick\_Visser](https://avatars.discourse-cdn.com/v4/letter/d/d9b06d/32.png) [@Dick\_Visser](https://forum.ansible.com/u/Dick_Visser)\
**Post date:** [February 18, 2021, 9:25am UTC](https://forum.ansible.com/t/how-to-run-program-as-an-administrator/34640/2 "2021-02-18T09:25:11Z")

</div>

[https://docs.ansible.com/ansible/latest/user\_guide/become.html#become-directives](https://docs.ansible.com/ansible/latest/user_guide/become.html#become-directives)

---

<div class="post-metadata">

**Author:** ![sd1](https://avatars.discourse-cdn.com/v4/letter/s/7ea924/32.png) [@sd1](https://forum.ansible.com/u/sd1)\
**Post date:** [February 18, 2021, 10:02am UTC](https://forum.ansible.com/t/how-to-run-program-as-an-administrator/34640/3 "2021-02-18T10:02:57Z")

</div>

Hi thanks for your reply.But I think win\_package module does not support become parameter.

---

<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:** [February 18, 2021, 10:21am UTC](https://forum.ansible.com/t/how-to-run-program-as-an-administrator/34640/4 "2021-02-18T10:21:04Z")

</div>

Any Windows module supports become, it’s implementation is completely independent from modules themselves. In the majority of situations a module is run as Administrator but there are a few cases where that may not apply. To test it out run

- win\_whoami:

You can also run it with become to test it out. If the Mandatory label in the groups section of the win\_whoami output is High then it’s running as Administrator.
