# One Agent uninstall Windows

**URL:** <https://community.dynatrace.com/t/one-agent-uninstall-windows/21982>\
**Category:** Open Q&A\
**Tags:** installation, oneagent\
**Created:** [September 19, 2019, 8:52am UTC](https://community.dynatrace.com/t/one-agent-uninstall-windows/21982 "2019-09-19T08:52:43Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![service\_apms](https://avatars.discourse-cdn.com/v4/letter/s/c4cdca/32.png) [@service\_apms](https://community.dynatrace.com/u/service_apms)\
**Post date:** [September 19, 2019, 8:52am UTC](https://community.dynatrace.com/t/one-agent-uninstall-windows/21982/1 "2019-09-19T08:52:43Z")

</div>

Hello

Does anyone has a script of uninstalling One Agent via the command line ?

Thank you

---

<div class="post-metadata">

**Author:** ![bartosz\_pollok](https://dub1.discourse-cdn.com/dynatrace/user_avatar/community.dynatrace.com/bartosz_pollok/32/24591_2.png) [@bartosz\_pollok](https://community.dynatrace.com/u/bartosz_pollok)\
**Post date:** [September 19, 2019, 9:05am UTC](https://community.dynatrace.com/t/one-agent-uninstall-windows/21982/2 "2019-09-19T09:05:06Z")

</div>

Hello,

You can uninstall OneAgent via the command line using command:

```auto
msiexec /x <OneAgent product code>

```

The product code can be retrieved using WMI utility:

```auto
wmic product where name='Dynatrace OneAgent' get IdentifyingNumber

```

This will return proper product identifier for your current OneAgent installation, which you should pass to former command to uninstall the OneAgent. You can place these two commands into a batch script and run it using elevated rights.

Regards,

Bartek

---

<div class="post-metadata">

**Author:** ![service\_apms](https://avatars.discourse-cdn.com/v4/letter/s/c4cdca/32.png) [@service\_apms](https://community.dynatrace.com/u/service_apms)\
**Post date:** [September 19, 2019, 10:12am UTC](https://community.dynatrace.com/t/one-agent-uninstall-windows/21982/3 "2019-09-19T10:12:44Z")

</div>

Thank you so much for your answer that was really helpfull

---

<div class="post-metadata">

**Author:** ![marco\_mannucci1](https://dub1.discourse-cdn.com/dynatrace/user_avatar/community.dynatrace.com/marco_mannucci1/32/16343_2.png) [@marco\_mannucci1](https://community.dynatrace.com/u/marco_mannucci1)\
**Post date:** [September 20, 2019, 12:10pm UTC](https://community.dynatrace.com/t/one-agent-uninstall-windows/21982/4 "2019-09-20T12:10:57Z")

</div>

Should that not be msiexec /uninstall /x \<OneAgent product code | Product.msi\> ??

---

<div class="post-metadata">

**Author:** ![bartosz\_pollok](https://dub1.discourse-cdn.com/dynatrace/user_avatar/community.dynatrace.com/bartosz_pollok/32/24591_2.png) [@bartosz\_pollok](https://community.dynatrace.com/u/bartosz_pollok)\
**Post date:** [September 20, 2019, 12:14pm UTC](https://community.dynatrace.com/t/one-agent-uninstall-windows/21982/5 "2019-09-20T12:14:23Z")

</div>

As far as I know, there’s no such thing as “/uninstall” switch for msiexec. “/x” is used for uninstalling MSI packages, see: [Command-Line Options - Win32 apps | Microsoft Learn](https://docs.microsoft.com/en-gb/windows/win32/msi/command-line-options).
