avhimkov
9/5/2016 - 9:16 AM

Install Java

Install Java

@ECHO OFF
REM Close all procces.
net stop JavaQuickStarterService
taskkill /F /IM iexplore.exe /T
taskkill /F /IM jqs.exe /T
taskkill /F /IM jucheck.exe /T
taskkill /F /IM javaw.exe /T

REM ============ Del Java ============
REM Save in file (GUID) install package Java in format Windows Installer
SET Query=name like 'Java SE%%' OR name like 'Java 9%%' OR name like 'Java 8%%' OR name like 'Java 7%%' OR name like 'Java(TM)%%' OR name like 'Java(TM) 6%%' OR name like 'J2SE Runtime Environment%%' OR name like 'Java 2 Runtime Environment%%' OR name like 'Java Auto Updater%%'
wmic product where "%Query%" get IdentifyingNumber > "%TEMP%\delJava_1.txt"

REM Save GUID package in two files
TYPE "%TEMP%\delJava_1.txt" | FINDSTR {........-....-....-....-............} > "%TEMP%\delJava_2.txt"

REM Cycle del package
FOR /f "tokens=*" %%a IN (%TEMP%\delJava_2.txt) DO (msiexec /x %%a /norestart /qn)

REM Del temp files
IF EXIST "%TEMP%\delJava_1.txt" DEL "%TEMP%\delJava_1.txt"
IF EXIST "%TEMP%\delJava_2.txt" DEL "%TEMP%\delJava_2.txt"

REM Silen install Java 9
REM D:\Soft\Coding\Java\JDK\jdk-9-ea+125_windows-x64_bin.exe /s
REM IF DEFINED ProgramW6432 ( jdk-9-ea+125_windows-x64_bin.exe /s )

REM Silen install Java 7
D:\Soft\Coding\Java\JDK\jdk-7u80-windows-i586.exe /s
IF DEFINED ProgramW6432 ( jdk-7u80-windows-i586.exe /s )

REM Silen install Java 8
D:\Soft\Coding\Java\JDK\jdk-8u101-windows-i586.exe /s
IF DEFINED ProgramW6432 ( jdk-8u101-windows-i586.exe /s )

REM Silen install Java 7
D:\Soft\Coding\Java\JDK\jdk-7u80-windows-x64.exe /s
IF DEFINED ProgramW6432 ( jdk-7u80-windows-x64.exe /s )

REM Silen install Java 8
D:\Soft\Coding\Java\JDK\jdk-8u101-windows-x64.exe /s
IF DEFINED ProgramW6432 ( jdk-8u101-windows-x64.exe /s )

@ECHO OFF
REM Close all procces.
net stop JavaQuickStarterService
taskkill /F /IM iexplore.exe /T
taskkill /F /IM jqs.exe /T
taskkill /F /IM jucheck.exe /T
taskkill /F /IM javaw.exe /T

REM ============ Delet Java ============
REM Save in file (GUID) install package Java in format Windows Installer
SET Query=name like 'Java SE%%' OR name like 'Java 9%%' OR name like 'Java(TM)%%' OR name like 'Java 8%%' OR name like 'Java 7%%' OR name like 'Java(TM) 6%%' OR name like 'J2SE Runtime Environment%%' OR name like 'Java 2 Runtime Environment%%' OR name like 'Java Auto Updater%%'
wmic product where "%Query%" get IdentifyingNumber > "%TEMP%\delJava_1.txt"

REM Save GUID package in two files
TYPE "%TEMP%\delJava_1.txt" | FINDSTR {........-....-....-....-............} > "%TEMP%\delJava_2.txt"

REM Cycle del package
FOR /f "tokens=*" %%a IN (%TEMP%\delJava_2.txt) DO (msiexec /x %%a /norestart /qn)

REM Del temp files
IF EXIST "%TEMP%\delJava_1.txt" DEL "%TEMP%\delJava_1.txt"
IF EXIST "%TEMP%\delJava_2.txt" DEL "%TEMP%\delJava_2.txt"
@ECHO OFF
REM Close all procces.
net stop JavaQuickStarterService
taskkill /F /IM iexplore.exe /T
taskkill /F /IM jqs.exe /T
taskkill /F /IM jucheck.exe /T
taskkill /F /IM javaw.exe /T

REM ============ Del Java ============
REM Save in file (GUID) install package Java in format Windows Installer
SET Query=name like 'Java 7%%' OR name like 'Java SE Development Kit 7%%'
wmic product where "%Query%" get IdentifyingNumber > "%TEMP%\delJava_1.txt"

REM Save GUID package in two files
TYPE "%TEMP%\delJava_1.txt" | FINDSTR {........-....-....-....-............} > "%TEMP%\delJava_2.txt"

REM Cycle del package
FOR /f "tokens=*" %%a IN (%TEMP%\delJava_2.txt) DO (msiexec /x %%a /norestart /qn)

REM Del temp files
IF EXIST "%TEMP%\delJava_1.txt" DEL "%TEMP%\delJava_1.txt"
IF EXIST "%TEMP%\delJava_2.txt" DEL "%TEMP%\delJava_2.txt"
@ECHO OFF
REM Close all procces.
net stop JavaQuickStarterService
taskkill /F /IM iexplore.exe /T
taskkill /F /IM jqs.exe /T
taskkill /F /IM jucheck.exe /T
taskkill /F /IM javaw.exe /T

REM ============ Del Java ============
REM Save in file (GUID) install package Java in format Windows Installer
SET Query=name like 'Java 9%%' OR name like  'Java(TM) SE Development Kit 9%%'
wmic product where "%Query%" get IdentifyingNumber > "%TEMP%\delJava_1.txt"

REM Save GUID package in two files
TYPE "%TEMP%\delJava_1.txt" | FINDSTR {........-....-....-....-............} > "%TEMP%\delJava_2.txt"

REM Cycle del package
FOR /f "tokens=*" %%a IN (%TEMP%\delJava_2.txt) DO (msiexec /x %%a /norestart /qn)

REM Del temp files
IF EXIST "%TEMP%\delJava_1.txt" DEL "%TEMP%\delJava_1.txt"
IF EXIST "%TEMP%\delJava_2.txt" DEL "%TEMP%\delJava_2.txt"

REM Silen install Java 9 x86
D:\Soft\Coding\Java\JDK\jdk-9-ea+134_windows-x86_bin.exe /s
IF DEFINED ProgramW6432 ( jdk-9-ea+134_windows-x86_bin.exe /s )

REM Silen install Java 9 x64
D:\Soft\Coding\Java\JDK\jdk-9-ea+134_windows-x64_bin.exe /s
IF DEFINED ProgramW6432 ( jdk-9-ea+134_windows-x64_bin.exe /s )

pause
@ECHO OFF
REM Close all procces.
net stop JavaQuickStarterService
taskkill /F /IM iexplore.exe /T
taskkill /F /IM jqs.exe /T
taskkill /F /IM jucheck.exe /T
taskkill /F /IM javaw.exe /T

REM ============ Del Java ============
REM Save in file (GUID) install package Java in format Windows Installer
SET Query=name like 'Java SE%%' OR name like 'Java 9%%' OR name like 'Java(TM)%%' OR name like 'Java 8%%' OR name like 'Java 7%%' OR name like 'Java(TM) 6%%' OR name like 'J2SE Runtime Environment%%' OR name like 'Java 2 Runtime Environment%%' OR name like 'Java Auto Updater%%'
wmic product where "%Query%" get IdentifyingNumber > "%TEMP%\delJava_1.txt"

REM Save GUID package in two files
TYPE "%TEMP%\delJava_1.txt" | FINDSTR {........-....-....-....-............} > "%TEMP%\delJava_2.txt"

REM Cycle del package
FOR /f "tokens=*" %%a IN (%TEMP%\delJava_2.txt) DO (msiexec /x %%a /norestart /qn)

REM Del temp files
IF EXIST "%TEMP%\delJava_1.txt" DEL "%TEMP%\delJava_1.txt"
IF EXIST "%TEMP%\delJava_2.txt" DEL "%TEMP%\delJava_2.txt"

REM Silen install Java 9
::D:\Soft\Coding\Java\JDK\jdk-9-ea+140_windows-x86_bin.exe /s
::IF DEFINED ProgramW6432 ( jdk-9-ea+140_windows-x86_bin.exe /s )

REM Silen install Java 9
D:\Soft\Coding\Java\JDK\jdk-9-ea+140_windows-x64_bin.exe /s
::IF DEFINED ProgramW6432 ( jdk-9-ea+140_windows-x64_bin.exe /s )

::REM Silen install Java 7
::D:\Soft\Coding\Java\JDK\jdk-7u80-windows-x64.exe /s
::IF DEFINED ProgramW6432 ( jdk-7u80-windows-x64.exe /s )

REM Silen install Java 8
::D:\Soft\Coding\Java\JDK\jdk-8u112-windows-i586.exe /s
::IF DEFINED ProgramW6432 ( jdk-8u112-windows-x64.exe /s )

REM Silen install Java 8
D:\Soft\Coding\Java\JDK\jdk-8u112-windows-x64.exe /s
::IF DEFINED ProgramW6432 ( jdk-8u112-windows-x64.exe /s )



::REM PATH Windows 7
::set JAVA_HOME=C:\Program Files\Java\jdk1.8.0_101

::REM PATH Windows 8-10
::setx JAVA_HOME "C:\Program Files\Java\jdk1.8.0_102"
@ECHO OFF
REM Close all procces.
net stop JavaQuickStarterService
taskkill /F /IM iexplore.exe /T
taskkill /F /IM jqs.exe /T
taskkill /F /IM jucheck.exe /T
taskkill /F /IM javaw.exe /T

REM ============ Del Java ============
REM Save in file (GUID) install package Java in format Windows Installer
SET Query=name like 'Java 9%%' OR name like  'Java(TM) SE Development Kit 9%%'
wmic product where "%Query%" get IdentifyingNumber > "%TEMP%\delJava_1.txt"

REM Save GUID package in two files
TYPE "%TEMP%\delJava_1.txt" | FINDSTR {........-....-....-....-............} > "%TEMP%\delJava_2.txt"

REM Cycle del package
FOR /f "tokens=*" %%a IN (%TEMP%\delJava_2.txt) DO (msiexec /x %%a /norestart /qn)

REM Del temp files
IF EXIST "%TEMP%\delJava_1.txt" DEL "%TEMP%\delJava_1.txt"
IF EXIST "%TEMP%\delJava_2.txt" DEL "%TEMP%\delJava_2.txt"

REM Silen install Java 9 x86
D:\Soft\Coding\Java\JDK\jdk-9-ea+140_windows-x64_bin.exe /s
IF DEFINED ProgramW6432 ( jdk-9-ea+140_windows-x64_bin.exe /s )

REM Silen install Java 9 x64
D:\Soft\Coding\Java\JDK\jdk-9-ea+140_windows-x64_bin.exe /s
IF DEFINED ProgramW6432 ( jdk-9-ea+140_windows-x64_bin.exe /s )

pause
@ECHO OFF
REM Close all procces.
net stop JavaQuickStarterService
taskkill /F /IM iexplore.exe /T
taskkill /F /IM jqs.exe /T
taskkill /F /IM jucheck.exe /T
taskkill /F /IM javaw.exe /T

REM ============ Del Java ============
REM Save in file (GUID) install package Java in format Windows Installer
SET Query=name like 'Java SE%%' OR name like 'Java(TM)%%' OR name like 'Java 8%%' OR name like 'Java 7%%' OR name like 'Java(TM) 6%%' OR name like 'J2SE Runtime Environment%%' OR name like 'Java 2 Runtime Environment%%' OR name like 'Java Auto Updater%%'
wmic product where "%Query%" get IdentifyingNumber > "%TEMP%\delJava_1.txt"

REM Save GUID package in two files
TYPE "%TEMP%\delJava_1.txt" | FINDSTR {........-....-....-....-............} > "%TEMP%\delJava_2.txt"

REM Cycle del package
FOR /f "tokens=*" %%a IN (%TEMP%\delJava_2.txt) DO (msiexec /x %%a /norestart /qn)

REM Del temp files
IF EXIST "%TEMP%\delJava_1.txt" DEL "%TEMP%\delJava_1.txt"
IF EXIST "%TEMP%\delJava_2.txt" DEL "%TEMP%\delJava_2.txt"

REM Silen install Java 9
::D:\Soft\Coding\Java\JDK\jdk-9-ea+140_windows-x86_bin.exe /s
::IF DEFINED ProgramW6432 ( jdk-9-ea+140_windows-x86_bin.exe /s )

REM Silen install Java 9
::D:\Soft\Coding\Java\JDK\jdk-9-ea+140_windows-x64_bin.exe /s
::IF DEFINED ProgramW6432 ( jdk-9-ea+140_windows-x64_bin.exe /s )

::REM Silen install Java 7
::D:\Soft\Coding\Java\JDK\jdk-7u80-windows-x64.exe /s
::IF DEFINED ProgramW6432 ( jdk-7u80-windows-x64.exe /s )

REM Silen install Java 8
D:\Soft\Coding\Java\JDK\jdk-8u112-windows-i586.exe /s
IF DEFINED ProgramW6432 ( jdk-8u112-windows-x64.exe /s )

REM Silen install Java 8
D:\Soft\Coding\Java\JDK\jdk-8u112-windows-x64.exe /s
IF DEFINED ProgramW6432 ( jdk-8u112-windows-x64.exe /s )



::REM PATH Windows 7
::set JAVA_HOME=C:\Program Files\Java\jdk1.8.0_101

::REM PATH Windows 8-10
::setx JAVA_HOME "C:\Program Files\Java\jdk1.8.0_102"