# Windows uninstall fails

**URL:** <https://discuss.elastic.co/t/windows-uninstall-fails/344403>\
**Category:** Elastic Agent\
**Created:** [October 4, 2023, 2:42pm UTC](https://discuss.elastic.co/t/windows-uninstall-fails/344403 "2023-10-04T14:42:49Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![GonzalezAldo](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/gonzalezaldo/32/126258_2.png) [@GonzalezAldo](https://discuss.elastic.co/u/GonzalezAldo)\
**Post date:** [October 4, 2023, 2:42pm UTC](https://discuss.elastic.co/t/windows-uninstall-fails/344403/1 "2023-10-04T14:42:50Z")

</div>

PS C:\Program Files\elastic\Agent\> .\elastic-agent.exe uninstall  
Error: can only be uninstalled by executing the installed Elastic Agent at: C:\Program Files\Elastic\Agent\elastic-agent.exe  
For help, please see our troubleshooting guide at [Troubleshoot common problems | Fleet and Elastic Agent Guide [8.8] | Elastic](https://www.elastic.co/guide/en/fleet/8.8/fleet-troubleshooting.html)

PS C:\> C:"Program Files"\Elastic\Agent\elastic-agent.exe uninstall  
Error: can only be uninstalled by executing the installed Elastic Agent at: C:\Program Files\Elastic\Agent\elastic-agent.exe  
For help, please see our troubleshooting guide at [Troubleshoot common problems | Fleet and Elastic Agent Guide [8.8] | Elastic](https://www.elastic.co/guide/en/fleet/8.8/fleet-troubleshooting.html)

Powershell session running as admin

---

<div class="post-metadata">

**Author:** ![Bradut\_B](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/bradut_b/32/119730_2.png) [@Bradut\_B](https://discuss.elastic.co/u/Bradut_B)\
**Post date:** [October 11, 2023, 3:44pm UTC](https://discuss.elastic.co/t/windows-uninstall-fails/344403/2 "2023-10-11T15:44:25Z")

</div>

I guess you get the same error if uninstalling from the CMD running as admin?

---

<div class="post-metadata">

**Author:** ![system](https://us1.discourse-cdn.com/elastic/original/3X/1/a/1ac57faf039f6b580b3f104ef42a2a89e41014de.png) [@system](https://discuss.elastic.co/u/system)\
**Post date:** [November 8, 2023, 3:45pm UTC](https://discuss.elastic.co/t/windows-uninstall-fails/344403/3 "2023-11-08T15:45:05Z")

</div>

This topic was automatically closed 28 days after the last reply. New replies are no longer allowed.
