/build/static/layout/Breadcrumb_cap_w.png

How to create a script for Java 7 Update 11 in Kace 1000

I would like to know how to create a script for Java 7 Update 11 in Kace 1000. 


0 Comments   [ + ] Show comments

Answers (2)

Posted by: c_brock 11 years ago
Third Degree Brown Belt
1

Here is a script that will remove the previous versions of Java and install Java 7 update 11!

http://www.itninja.com/blog/view/kace-install-java-7-update-11-using-a-script-removes-previous-versions

 

Posted by: dnnelson1969 11 years ago
Second Degree Blue Belt
0

This is a generic batch script I wrote and used to cleanup and push Java in a mixed x64 x86 environment. I've used this with SCCM 2007 R2. But if Kace 1000 can execute batch files on the client side, it should work fine. You will need the EXE for both x64 and x86 as well as extracting the x86 exe to an MSI by installing it on a system first and locating the cached MSI files. 

Let me know if this will work for you. 

REM JAVA Uninstall and cleanup script for through Java 1.7.u11 

REM with install of Java 1.7.u11 x86 and X64 in Mixed Environment
REM Calls removal of Java Autoupdate after install
REM Skips Removal of versions of Java 1.6.x if SAS is detected
REM These can be removed if your environment does not use SAS or uses built in Java for SAS
REM Requires x86 and x64 JRE Executables and x86 MSI files to install x86 Java on x64
REM MSI files can be located in
REM C:\Documents and Settings\<install user>\Application Data\Sun\Java\<version> or
REM C:\Users\<install user>\Appdata\locallow\Sun\Java\<Version>
REM after install to a workstation preferably 32-bit
REM written for use in SCCM 2007, but will likely work elsewhere
REM Written by David Nelson, Computer Professional, CSBS Computing, University of Utah
REM 2012-2013
@ECHO OFF

REM Close all open web browsers

:killfirefox
taskkill /f /t /im firefox.exe
tasklist /FI "IMAGENAME eq firefox.exe" 2>NUL | find /I /N "firefox.exe">NUL
if "%ERRORLEVEL%"=="0" GOTO killfirefox


:killiexplore
taskkill /f /t /im iexplore.exe
tasklist /FI "IMAGENAME eq iexplore.exe" 2>NUL | find /I /N "iexplore.exe">NUL
if "%ERRORLEVEL%"=="0" GOTO killiexplore


:killchrome
taskkill /f /t /im chrome.exe
tasklist /FI "IMAGENAME eq chrome.exe" 2>NUL | find /I /N "chrome.exe">NUL
if "%ERRORLEVEL%"=="0" GOTO killchrome

REM Close all JAVA Background Processes


:killjusched
taskkill /f /t /im jusched.exe
tasklist /FI "IMAGENAME eq jusched.exe" 2>NUL | find /I /N "jusched.exe">NUL
if "%ERRORLEVEL%"=="0" GOTO killjusched

:killjucheck
taskkill /f /t /im jucheck.exe
tasklist /FI "IMAGENAME eq jucheck.exe" 2>NUL | find /I /N "jucheck.exe">NUL
if "%ERRORLEVEL%"=="0" GOTO killjucheck

:killjqs
taskkill /f /t /im jqs.exe
tasklist /FI "IMAGENAME eq jqs.exe" 2>NUL | find /I /N "jqs.exe">NUL
if "%ERRORLEVEL%"=="0" GOTO killjqs


REM Silent Uninstallers

REM 64bit
REM 1.6.00 - 1.6.37
msiexec.exe /qn /norestart /x {26A24AE4-039D-4CA4-87B4-2F86416000FF}
msiexec.exe /qn /norestart /x {26A24AE4-039D-4CA4-87B4-2F86416001FF}
msiexec.exe /qn /norestart /x {26A24AE4-039D-4CA4-87B4-2F86416002FF}
msiexec.exe /qn /norestart /x {26A24AE4-039D-4CA4-87B4-2F86416003FF}
msiexec.exe /qn /norestart /x {26A24AE4-039D-4CA4-87B4-2F86416004FF}
msiexec.exe /qn /norestart /x {26A24AE4-039D-4CA4-87B4-2F86416005FF}
msiexec.exe /qn /norestart /x {26A24AE4-039D-4CA4-87B4-2F86416006FF}
msiexec.exe /qn /norestart /x {26A24AE4-039D-4CA4-87B4-2F86416007FF}
msiexec.exe /qn /norestart /x {26A24AE4-039D-4CA4-87B4-2F86416008FF}
msiexec.exe /qn /norestart /x {26A24AE4-039D-4CA4-87B4-2F86416009FF}
msiexec.exe /qn /norestart /x {26A24AE4-039D-4CA4-87B4-2F86416010FF}
msiexec.exe /qn /norestart /x {26A24AE4-039D-4CA4-87B4-2F86416011FF}
msiexec.exe /qn /norestart /x {26A24AE4-039D-4CA4-87B4-2F86416012FF}
msiexec.exe /qn /norestart /x {26A24AE4-039D-4CA4-87B4-2F86416013FF}
msiexec.exe /qn /norestart /x {26A24AE4-039D-4CA4-87B4-2F86416014FF}
msiexec.exe /qn /norestart /x {26A24AE4-039D-4CA4-87B4-2F86416015FF}
msiexec.exe /qn /norestart /x {26A24AE4-039D-4CA4-87B4-2F86416016FF}
msiexec.exe /qn /norestart /x {26A24AE4-039D-4CA4-87B4-2F86416017FF}
msiexec.exe /qn /norestart /x {26A24AE4-039D-4CA4-87B4-2F86416018FF}
msiexec.exe /qn /norestart /x {26A24AE4-039D-4CA4-87B4-2F86416019FF}
msiexec.exe /qn /norestart /x {26A24AE4-039D-4CA4-87B4-2F86416020FF}
msiexec.exe /qn /norestart /x {26A24AE4-039D-4CA4-87B4-2F86416021FF}
msiexec.exe /qn /norestart /x {26A24AE4-039D-4CA4-87B4-2F86416022FF}
msiexec.exe /qn /norestart /x {26A24AE4-039D-4CA4-87B4-2F86416023FF}
msiexec.exe /qn /norestart /x {26A24AE4-039D-4CA4-87B4-2F86416024FF}
msiexec.exe /qn /norestart /x {26A24AE4-039D-4CA4-87B4-2F86416025FF}
msiexec.exe /qn /norestart /x {26A24AE4-039D-4CA4-87B4-2F86416026FF}
msiexec.exe /qn /norestart /x {26A24AE4-039D-4CA4-87B4-2F86416027FF}
msiexec.exe /qn /norestart /x {26A24AE4-039D-4CA4-87B4-2F86416028FF}
msiexec.exe /qn /norestart /x {26A24AE4-039D-4CA4-87B4-2F86416029FF}
msiexec.exe /qn /norestart /x {26A24AE4-039D-4CA4-87B4-2F86416030FF}
msiexec.exe /qn /norestart /x {26A24AE4-039D-4CA4-87B4-2F86416031FF}
msiexec.exe /qn /norestart /x {26A24AE4-039D-4CA4-87B4-2F86416032FF}
msiexec.exe /qn /norestart /x {26A24AE4-039D-4CA4-87B4-2F86416033FF}
msiexec.exe /qn /norestart /x {26A24AE4-039D-4CA4-87B4-2F86416034FF}
msiexec.exe /qn /norestart /x {26A24AE4-039D-4CA4-87B4-2F86416035FF}
msiexec.exe /qn /norestart /x {26A24AE4-039D-4CA4-87B4-2F86416036FF}
msiexec.exe /qn /norestart /x {26A24AE4-039D-4CA4-87B4-2F86416037FF}
REM 1.7.00 - 1.7.11
msiexec.exe /qn /norestart /x {26A24AE4-039D-4CA4-87B4-2F86417000FF}
msiexec.exe /qn /norestart /x {26A24AE4-039D-4CA4-87B4-2F86417001FF}
msiexec.exe /qn /norestart /x {26A24AE4-039D-4CA4-87B4-2F86417002FF}
msiexec.exe /qn /norestart /x {26A24AE4-039D-4CA4-87B4-2F86417003FF}
msiexec.exe /qn /norestart /x {26A24AE4-039D-4CA4-87B4-2F86417004FF}
msiexec.exe /qn /norestart /x {26A24AE4-039D-4CA4-87B4-2F86417005FF}
msiexec.exe /qn /norestart /x {26A24AE4-039D-4CA4-87B4-2F86417006FF}
msiexec.exe /qn /norestart /x {26A24AE4-039D-4CA4-87B4-2F86417007FF}
msiexec.exe /qn /norestart /x {26A24AE4-039D-4CA4-87B4-2F86417008FF}
msiexec.exe /qn /norestart /x {26A24AE4-039D-4CA4-87B4-2F86417009FF}
msiexec.exe /qn /norestart /x {26A24AE4-039D-4CA4-87B4-2F86417010FF}
msiexec.exe /qn /norestart /x {26A24AE4-039D-4CA4-87B4-2F86417011FF}

REM 32bit
REM 1.4.2 - 1.4.2_19
msiexec.exe /qn /norestart /x {7148F0A8-6813-11D6-A77B-00B0D0142000}
msiexec.exe /qn /norestart /x {7148F0A8-6813-11D6-A77B-00B0D0142010}
msiexec.exe /qn /norestart /x {7148F0A8-6813-11D6-A77B-00B0D0142020}
msiexec.exe /qn /norestart /x {7148F0A8-6813-11D6-A77B-00B0D0142030}
msiexec.exe /qn /norestart /x {7148F0A8-6813-11D6-A77B-00B0D0142040}
msiexec.exe /qn /norestart /x {7148F0A8-6813-11D6-A77B-00B0D0142050}
msiexec.exe /qn /norestart /x {7148F0A8-6813-11D6-A77B-00B0D0142060}
msiexec.exe /qn /norestart /x {7148F0A8-6813-11D6-A77B-00B0D0142070}
msiexec.exe /qn /norestart /x {7148F0A8-6813-11D6-A77B-00B0D0142080}
msiexec.exe /qn /norestart /x {7148F0A8-6813-11D6-A77B-00B0D0142090}
msiexec.exe /qn /norestart /x {7148F0A8-6813-11D6-A77B-00B0D0142100}
msiexec.exe /qn /norestart /x {7148F0A8-6813-11D6-A77B-00B0D0142110}
msiexec.exe /qn /norestart /x {7148F0A8-6813-11D6-A77B-00B0D0142120}
msiexec.exe /qn /norestart /x {7148F0A8-6813-11D6-A77B-00B0D0142130}
msiexec.exe /qn /norestart /x {7148F0A8-6813-11D6-A77B-00B0D0142140}
msiexec.exe /qn /norestart /x {7148F0A8-6813-11D6-A77B-00B0D0142150}
msiexec.exe /qn /norestart /x {7148F0A8-6813-11D6-A77B-00B0D0142160}
msiexec.exe /qn /norestart /x {7148F0A8-6813-11D6-A77B-00B0D0142170}
msiexec.exe /qn /norestart /x {7148F0A8-6813-11D6-A77B-00B0D0142180}
msiexec.exe /qn /norestart /x {7148F0A8-6813-11D6-A77B-00B0D0142190}
REM 1.5.00 - 1.5.22
msiexec.exe /qn /norestart /x {3248F0A8-6813-11D6-A77B-00B0D0150000}
msiexec.exe /qn /norestart /x {3248F0A8-6813-11D6-A77B-00B0D0150010}
msiexec.exe /qn /norestart /x {3248F0A8-6813-11D6-A77B-00B0D0150020}
msiexec.exe /qn /norestart /x {3248F0A8-6813-11D6-A77B-00B0D0150030}
msiexec.exe /qn /norestart /x {3248F0A8-6813-11D6-A77B-00B0D0150040}
msiexec.exe /qn /norestart /x {3248F0A8-6813-11D6-A77B-00B0D0150050}
msiexec.exe /qn /norestart /x {3248F0A8-6813-11D6-A77B-00B0D0150060}
msiexec.exe /qn /norestart /x {3248F0A8-6813-11D6-A77B-00B0D0150070}
msiexec.exe /qn /norestart /x {3248F0A8-6813-11D6-A77B-00B0D0150080}
msiexec.exe /qn /norestart /x {3248F0A8-6813-11D6-A77B-00B0D0150090}
msiexec.exe /qn /norestart /x {3248F0A8-6813-11D6-A77B-00B0D0150100}
msiexec.exe /qn /norestart /x {3248F0A8-6813-11D6-A77B-00B0D0150110}
msiexec.exe /qn /norestart /x {3248F0A8-6813-11D6-A77B-00B0D0150120}
msiexec.exe /qn /norestart /x {3248F0A8-6813-11D6-A77B-00B0D0150130}
msiexec.exe /qn /norestart /x {3248F0A8-6813-11D6-A77B-00B0D0150140}
msiexec.exe /qn /norestart /x {3248F0A8-6813-11D6-A77B-00B0D0150150}
msiexec.exe /qn /norestart /x {3248F0A8-6813-11D6-A77B-00B0D0150160}
msiexec.exe /qn /norestart /x {3248F0A8-6813-11D6-A77B-00B0D0150170}
msiexec.exe /qn /norestart /x {3248F0A8-6813-11D6-A77B-00B0D0150180}
msiexec.exe /qn /norestart /x {3248F0A8-6813-11D6-A77B-00B0D0150190}
msiexec.exe /qn /norestart /x {3248F0A8-6813-11D6-A77B-00B0D0150200}
msiexec.exe /qn /norestart /x {3248F0A8-6813-11D6-A77B-00B0D0150210}
msiexec.exe /qn /norestart /x {3248F0A8-6813-11D6-A77B-00B0D0150220}

REM Below lines can be REMed if your environment does not need it
REM Check to Skip Java 1.6x uninstall if SAS exists
If exist "c:\Program Files\SAS\NUL" GOTO skipjava16x86uninst

If exist "c:\Program Files (x86)\SAS\NUL" GOTO skipjava16x86uninst
REM Above lines can be REMed

REM 1.6.00 - 1.6.37
msiexec.exe /qn /norestart /x {3248F0A8-6813-11D6-A77B-00B0D0160000}
msiexec.exe /qn /norestart /x {3248F0A8-6813-11D6-A77B-00B0D0160010}
msiexec.exe /qn /norestart /x {3248F0A8-6813-11D6-A77B-00B0D0160020}
msiexec.exe /qn /norestart /x {3248F0A8-6813-11D6-A77B-00B0D0160030}
msiexec.exe /qn /norestart /x {3248F0A8-6813-11D6-A77B-00B0D0160040}
msiexec.exe /qn /norestart /x {3248F0A8-6813-11D6-A77B-00B0D0160050}
msiexec.exe /qn /norestart /x {3248F0A8-6813-11D6-A77B-00B0D0160060}
msiexec.exe /qn /norestart /x {3248F0A8-6813-11D6-A77B-00B0D0160070}
msiexec.exe /qn /norestart /x {3248F0A8-6813-11D6-A77B-00B0D0160080}
msiexec.exe /qn /norestart /x {3248F0A8-6813-11D6-A77B-00B0D0160090}
msiexec.exe /qn /norestart /x {3248F0A8-6813-11D6-A77B-00B0D0160100}
msiexec.exe /qn /norestart /x {3248F0A8-6813-11D6-A77B-00B0D0160110}
msiexec.exe /qn /norestart /x {3248F0A8-6813-11D6-A77B-00B0D0160120}
msiexec.exe /qn /norestart /x {3248F0A8-6813-11D6-A77B-00B0D0160130}
msiexec.exe /qn /norestart /x {3248F0A8-6813-11D6-A77B-00B0D0160140}
msiexec.exe /qn /norestart /x {3248F0A8-6813-11D6-A77B-00B0D0160150}
msiexec.exe /qn /norestart /x {3248F0A8-6813-11D6-A77B-00B0D0160160}
msiexec.exe /qn /norestart /x {3248F0A8-6813-11D6-A77B-00B0D0160170}
msiexec.exe /qn /norestart /x {3248F0A8-6813-11D6-A77B-00B0D0160180}
msiexec.exe /qn /norestart /x {3248F0A8-6813-11D6-A77B-00B0D0160190}
msiexec.exe /qn /norestart /x {3248F0A8-6813-11D6-A77B-00B0D0160200}
msiexec.exe /qn /norestart /x {3248F0A8-6813-11D6-A77B-00B0D0160210}
msiexec.exe /qn /norestart /x {3248F0A8-6813-11D6-A77B-00B0D0160220}
msiexec.exe /qn /norestart /x {26A24AE4-039D-4CA4-87B4-2F83216023FF}
msiexec.exe /qn /norestart /x {26A24AE4-039D-4CA4-87B4-2F83216024FF}
msiexec.exe /qn /norestart /x {26A24AE4-039D-4CA4-87B4-2F83216025FF}
msiexec.exe /qn /norestart /x {26A24AE4-039D-4CA4-87B4-2F83216026FF}
msiexec.exe /qn /norestart /x {26A24AE4-039D-4CA4-87B4-2F83216027FF}
msiexec.exe /qn /norestart /x {26A24AE4-039D-4CA4-87B4-2F83216028FF}
msiexec.exe /qn /norestart /x {26A24AE4-039D-4CA4-87B4-2F83216029FF}
msiexec.exe /qn /norestart /x {26A24AE4-039D-4CA4-87B4-2F83216030FF}
msiexec.exe /qn /norestart /x {26A24AE4-039D-4CA4-87B4-2F83216031FF}
msiexec.exe /qn /norestart /x {26A24AE4-039D-4CA4-87B4-2F83216032FF}
msiexec.exe /qn /norestart /x {26A24AE4-039D-4CA4-87B4-2F83216033FF}
msiexec.exe /qn /norestart /x {26A24AE4-039D-4CA4-87B4-2F83216034FF}
msiexec.exe /qn /norestart /x {26A24AE4-039D-4CA4-87B4-2F83216035FF}
msiexec.exe /qn /norestart /x {26A24AE4-039D-4CA4-87B4-2F83216036FF}
msiexec.exe /qn /norestart /x {26A24AE4-039D-4CA4-87B4-2F83216037FF}

REM Below line can be REMed if your environment does not need it
:skipjava16x86uninst

REM 1.7.00 - 1.7.11
msiexec.exe /qn /norestart /x {26A24AE4-039D-4CA4-87B4-2F83217001FF}
msiexec.exe /qn /norestart /x {26A24AE4-039D-4CA4-87B4-2F83217002FF}
msiexec.exe /qn /norestart /x {26A24AE4-039D-4CA4-87B4-2F83217003FF}
msiexec.exe /qn /norestart /x {26A24AE4-039D-4CA4-87B4-2F83217004FF}
msiexec.exe /qn /norestart /x {26A24AE4-039D-4CA4-87B4-2F83217005FF}
msiexec.exe /qn /norestart /x {26A24AE4-039D-4CA4-87B4-2F83217006FF}
msiexec.exe /qn /norestart /x {26A24AE4-039D-4CA4-87B4-2F83217007FF}
msiexec.exe /qn /norestart /x {26A24AE4-039D-4CA4-87B4-2F83217008FF}
msiexec.exe /qn /norestart /x {26A24AE4-039D-4CA4-87B4-2F83217009FF}
msiexec.exe /qn /norestart /x {26A24AE4-039D-4CA4-87B4-2F83217010FF}
msiexec.exe /qn /norestart /x {26A24AE4-039D-4CA4-87B4-2F83217011FF}


REM Cleanup Java Auto Updater for Windows 7
IF EXIST C:\Windows\Installer\1160852.msi (
msiexec.exe /qn /norestart /x  C:\Windows\Installer\1160852.msi
)
IF EXIST C:\Users\Default\AppData\LocalLow\Sun\Java\AU\au.msi (
msiexec /x C:\Users\Default\AppData\LocalLow\Sun\Java\AU\au.msi /qn /norestart
)

REM WMIC cleanup if
Start /wait wmic product where "name like 'Java%' and not name like '%SE%'" call uninstall

REM Java Executable Silent Install

REM SET MSIArgs=/qn /norestart REBOOT=ReallySuppress
REM SET MSIComp=ADDLOCAL=jrecore IEXPLORER=1 MOZILLA=1 JAVAUPDATE=0 WEBSTARTICON=0
REM Checks for a 64-bit environment and installs x64 then x86 Java
REM Otherwise assumes 32 bit and installs x86 Java in x86 environment
REM Extracted 32 bit MSI files required for silent install on x64 machines
REM due to a known incompatibility between 32 bit executable silent switch on x64 machines

IF EXIST "%ProgramFiles(x86)%" (
  START /WAIT jre-7u11-windows-x64.exe /s /v"/passive /norestart AUTOUPDATECHECK=0 JAVAUPDATE=0 JU=0 WEBSTARTICON=0 EULA=0 SYSTRAY=0"
  START /WAIT msiexec /qn /i jre1.7.0_11.msi /norestart AUTOUPDATECHECK=0 JAVAUPDATE=0 JU=0 WEBSTARTICON=0 EULA=0 SYSTRAY=0
) ELSE (
  START /WAIT jre-7u11-windows-i586.exe /s /v"/passive /norestart AUTOUPDATECHECK=0 JAVAUPDATE=0 JU=0 WEBSTARTICON=0 EULA=0 SYSTRAY=0"
)

REM Uninstall Java Autoupdater
wmic product where "name like 'Java%Auto%'" call uninstall

REM Return exit code to SCCM
exit /B %EXIT_CODE%

Comments:
  • Depending on what is required for Kace 1000 you may need to add %~dp0\ to the front of the install paths for the installers so that the batch file can locate the installers via UNC.

    Example:
    START /WAIT jre-7u11-windows-x64.exe /s /v"/passive /norestart AUTOUPDATECHECK=0 JAVAUPDATE=0 JU=0 WEBSTARTICON=0 EULA=0 SYSTRAY=0"

    may need to be modified to

    START /WAIT %~dp0\jre-7u11-windows-x64.exe /s /v"/passive /norestart AUTOUPDATECHECK=0 JAVAUPDATE=0 JU=0 WEBSTARTICON=0 EULA=0 SYSTRAY=0" - dnnelson1969 11 years ago
  • Thanks for the script. I'm interested in using it, but I don't understand where it and the associated files go in our Kace appliance. Can you point me in the right direction? - robbertv 11 years ago
  • I used this script successfully to uninstall old versions of Java and install 7 u 21. Now I am editing it to install 8 u 25. From what I am reading it looks like you only need the 32 bit version, even on 64 bit computers. Is that true? - jfrasier 9 years ago
    • You only need x64 if Java is being called from 64 bit software such as 64 bit Chrome or IE or other software such as x64 SAS. x86 will work on x64 systems for all 32 bit browsers. - dnnelson1969 9 years ago

Don't be a Stranger!

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

Sign up! or login

Share

 
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