Scripting Question

Script work on some PC but not others

11/17/2015 1554 views


 We created a script to remove old java from PC and install the new version 8u51. It works on a new PC we placed on the network, but does not work on PC that have been on the network for some time. Both have the same version of Kace on it.  The new PC we can see the program installing and the other it just flashes in task manager for a while then disappears, while the new PC you can see it installing in task manager.

Please help!!!!!!


1 Comment   [ + ] Show comment


  • Sounds like the batch file is not returning as successful.
    We would need more details(Error Logs, return/status codes from K1 agent)

Community Chosen Answer

try checking "on failure" Continue instead of break.  unless every single version of java you are trying to remove runs it will generate a failure during the uninstall.

I have switched to using wmic to uninstall old java in my search and destroy java script.
Just make sure to check "wait for completion" for each step.

/c wmic product where "name like 'Java 7 Update%%'" call uninstall /nointeractive


Currently patching is pushing out j8u66 but prior to it showing up I was using an MI to install

Answered 11/18/2015 by: SMal.tmcc
Red Belt

All Answers

>We would need more details(Error Logs, return/status codes from K1 agent)
Quite. By the look of the screenshot, your MSIEXEC command line doesn't include logging. Add verbose logging and re-try. Having said that, JRE MSIs are merely a "transport" for the Java installer, not "proper" MSIs but at least you'll get something!

Also, in this kind of scenario, you should:
- test the script from a command line on a failing machine
- once you're happy that it works, re-test using PSExec, using the same account to execute as KBox, normally, the local System account
- re-test from KBox.

You might also want to take a copy of a failing machine and create an off-line VM from it. That way, you can test at your leisure and not disrupt the user.
Answered 11/18/2015 by: VBScab
Red Belt

  • Removal old Java works its the installation of the new Java that does not. It starts then ends quickly. On PC that it works java installation take a while longer.
Yes, our psychic powers told us that already.

Extract the MSI from the new EXE and use that, adding logging to that.

BTW, you're aware, are you, that you're not disabling automatic updates or the brain-dead "JRE is out of date" prompt? Both are documented here in IT Ninja.
Answered 11/18/2015 by: VBScab
Red Belt

Got the script to work. Thanks everyone for the comments.
Answered 11/18/2015 by: Kdebiasse
8th Degree Black Belt

  • could you mark it answered

Don't be a Stranger!

Sign up today to participate, stay informed, earn points and establish a reputation for yourself!

Sign up! or login

View more:


This website uses cookies. By continuing to use this site and/or clicking the "Accept" button you are providing consent Quest Software and its affiliates do NOT sell the Personal Data you provide to us either when you register on our websites or when you do business with us. For more information about our Privacy Policy and our data protection efforts, please visit GDPR-HQ