# Unable to uninstall elastic agent silently

**URL:** <https://discuss.elastic.co/t/unable-to-uninstall-elastic-agent-silently/372645>\
**Category:** Elastic Agent\
**Created:** [December 30, 2024, 11:29pm UTC](https://discuss.elastic.co/t/unable-to-uninstall-elastic-agent-silently/372645 "2024-12-30T23:29:31Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![Al1984](https://avatars.discourse-cdn.com/v4/letter/a/b5e925/32.png) [@Al1984](https://discuss.elastic.co/u/Al1984)\
**Post date:** [December 30, 2024, 11:29pm UTC](https://discuss.elastic.co/t/unable-to-uninstall-elastic-agent-silently/372645/1 "2024-12-30T23:29:31Z")

</div>

Hi All, I'm trying to use the following query "C:\Program Files\Elastic\Agent\elastic-agent.exe uninstall" to uninstall the Elastic agent on many devices, if I run that script on one device it uninstall the agent successfully but it requires users interference the users needs to type Y to approve the uninstall, is there any way to do this silently? Thanks

---

<div class="post-metadata">

**Author:** ![leandrojmp](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/leandrojmp/32/107231_2.png) [@leandrojmp](https://discuss.elastic.co/u/leandrojmp)\
**Post date:** [December 30, 2024, 11:37pm UTC](https://discuss.elastic.co/t/unable-to-uninstall-elastic-agent-silently/372645/2 "2024-12-30T23:37:03Z")

</div>

Hello and welcome,

Yes, you need to use `--force`.

Per the [documentation](https://www.elastic.co/guide/en/fleet/current/elastic-agent-cmd-options.html#elastic-agent-uninstall-command).

> `--force`  
> Uninstall Elastic Agent and **do not prompt for confirmation**. **This flag is helpful when using automation software or scripted deployments**.
