You can uninstall OneAgent via the command line using command:
msiexec /x <OneAgent product code>
The product code can be retrieved using WMI utility:
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.