As a solution, the attached KScript can be imported and slightly modified to detect and remove all instances of JRE from one or more systems. This can be used prior to rolling out a Managed Install or KScript to deploy the latest version of JRE to your environment. To import and deploy this KScript, perform the following:
- Download the attached .kpkg file.
- Import the KScript using the .kpkg file and instructions located at https://support.quest.com/kb/116949.
- Go to the KScript's detail page in the administrative user interface using the /adminui URL (e.g. http://kbox/adminui). You'll need the script ID for the next step, and the easiest way to obtain this is with the unmasked /adminui URL.
- Modify the KScript as follows:
- Under Deploy: Choose the targeted machines and/or labels (or All Devices).
- Under Task 1 > Remediation, click Edit next to the "Run the batch file" step.
- Look in your address bar for the script ID. In this example, it is 178.

- At the end of the powershell.exe command in the batch file, the ID is listed in the file path (powershell.exe -ExecutionPolicy Bypass -File "C:\ProgramData\Dell\KACE\kbots_cache\packages\kbots\178\remove_all_jre.ps1"). Ensure this ID matches the ID in your address bar. Again, in this example the ID is 178.

- Save changes for the KScript.
- Deploy the KScript using Run Now or a schedule. Keep in mind that a scheduled run of this script will remove all versions of JRE from every targeted machine at each scheduled interval. This will be counterproductive if you plan on deploying a new version of JRE after running this KScript.
*NOTE: When deploying newer JRE versions, the available options for deployment (Managed Install versus KScript) differ between the .exe (cannot be installed as a Managed Installation under the SYSTEM context; must be installed via KScript using Administrative credentials) and .msi versions (the MSI now requires a special license from Oracle). This is explained in further detail at https://support.quest.com/kb/149248.