Java Uninstall Script

Could someone at Comodo please write a procedure/script to uninstall all but the latest version of JRE?

We used to use the original Patch Management module and for some reason a bunch of PCs have multiple versions of Java on them, I’d like to have just the latest one so that nobody accidentally uses a vulnerable version. Probably the new third party patch management built into ITSM won’t have this weird behavior to install multiple versions of JRE, this is what we are using now.