anchor.diff:  :::::::::::::::::::::::::
   :: x64
   if %REINSTALL_JAVA_x64%==yes (
  -    echo %CUR_DATE% %TIME% ! Variable "REINSTALL_JAVA_x64" was set to 'yes'. Now installing %JAVA_BINARY_x64%...>> "%LOGPATH%\%LOGFILE%"
  -    echo %CUR_DATE% %TIME% ! Variable "REINSTALL_JAVA_x64" was set to 'yes'. Now installing %JAVA_BINARY_x64%...
  -    "%JAVA_LOCATION_x64%\%JAVA_BINARY_x64%" %JAVA_ARGUMENTS_x64%
  -    java -version
  -    echo Done.>> "%LOGPATH%\%LOGFILE%"
  -    )
  +	call :log "%CUR_DATE% %TIME% ! Variable "REINSTALL_JAVA_x64" was set to 'yes'. Now installing %JAVA_BINARY_x64%..."
  +	"%JAVA_LOCATION_x64%\%JAVA_BINARY_x64%" %JAVA_ARGUMENTS_x64%
  +	java -version
  +	echo Done.>> "%LOGPATH%\%LOGFILE%"
  +)
   
   :: x86
   if %REINSTALL_JAVA_x86%==yes (
  -    echo %CUR_DATE% %TIME% ! Variable "REINSTALL_JAVA_x86" was set to 'yes'. Now installing %JAVA_BINARY_x86%...>> "%LOGPATH%\%LOGFILE%"
  -    echo %CUR_DATE% %TIME% ! Variable "REINSTALL_JAVA_x86" was set to 'yes'. Now installing %JAVA_BINARY_x86%...
  -    "%JAVA_LOCATION_x86%\%JAVA_BINARY_x86%" %JAVA_ARGUMENTS_x86%
  -    java -version
  -    echo Done.>> "%LOGPATH%\%LOGFILE%"
  -    )
  +	call :log "%CUR_DATE% %TIME% ! Variable "REINSTALL_JAVA_x86" was set to 'yes'. Now installing %JAVA_BINARY_x86%..."
  +	"%JAVA_LOCATION_x86%\%JAVA_BINARY_x86%" %JAVA_ARGUMENTS_x86%
  +	java -version
  +	echo Done.>> "%LOGPATH%\%LOGFILE%"
  +)
   
   :: Done.
  -echo %CUR_DATE% %TIME%   Registry hive backups: %TEMP%\java_purge_registry_backup\>> "%LOGPATH%\%LOGFILE%"
  -echo %CUR_DATE% %TIME%   Registry hive backups: %TEMP%\java_purge_registry_backup\
  -echo %CUR_DATE% %TIME%   Log file: "%LOGPATH%\%LOGFILE%">> "%LOGPATH%\%LOGFILE%"
  -echo %CUR_DATE% %TIME%   Log file: "%LOGPATH%\%LOGFILE%"
  -echo %CUR_DATE% %TIME%   JAVA NUKER COMPLETE. Recommend rebooting and washing your hands.>> "%LOGPATH%\%LOGFILE%"
  -echo %CUR_DATE% %TIME%   JAVA NUKER COMPLETE. Recommend rebooting and washing your hands.
  +call :log "%CUR_DATE% %TIME%   Registry hive backups: %TEMP%\java_purge_registry_backup\"
  +call :log "%CUR_DATE% %TIME%   Log file: "%LOGPATH%\%LOGFILE%""
  +call :log "%CUR_DATE% %TIME%   JAVA NUKER COMPLETE. Recommend rebooting and washing your hands."
   
   :: Return exit code to SCCM/PDQ Deploy/PSexec/etc
   exit /B %EXIT_CODE%
  +
  +
  +
  +
  +
  +
  +
  +
  +:::::::::::::::
  +:: FUNCTIONS ::
  +:::::::::::::::
  +:log
  +echo:%~1 >> "%LOGPATH%\%LOGFILE%"
  +echo:%~1
  +goto :eof
  
positive.code: %SystemRoot%\IsUninst.exe -f"%ProgramFiles(x86)%\JavaSoft\JRE\1.3\Uninst.isu" -a 2>NUL
  
  :: Java Update Service
  echo %CUR_DATE% %TIME%   Java Update Service...>> "%LOGPATH%\%LOGFILE%"
  echo %CUR_DATE% %TIME%   Java Update Service...
  wmic product where "name like 'Java Auto Updater'" call uninstall /nointeractive>> "%LOGPATH%\%LOGFILE%"
  
  :: Wildcard uninstallers
  echo %CUR_DATE% %TIME%   Specific targeting done. Now running WMIC wildcard catchall uninstallation...>> "%LOGPATH%\%LOGFILE%"
  echo %CUR_DATE% %TIME%   Specific targeting done. Now running WMIC wildcard catchall uninstallation...
  %WMIC% product where "name like '%%J2SE Runtime%%'" call uninstall /nointeractive>> "%LOGPATH%\%LOGFILE%"
  %WMIC% product where "name like 'Java%%Runtime%%'" call uninstall /nointeractive>> "%LOGPATH%\%LOGFILE%"
  %WMIC% product where "name like 'JavaFX%%'" call uninstall /nointeractive>> "%LOGPATH%\%LOGFILE%"
  echo %CUR_DATE% %TIME%   Done.>> "%LOGPATH%\%LOGFILE%"
  echo %CUR_DATE% %TIME%   Done.
  
  
  ::::::::::::::::::::::
  
negative.code: ::                 - /u/MrYiff          : bug fix related to OS_VERSION variable
  ::                 - /u/cannibalkitteh  : additional registry & file cleaning locations
  ::                 - forums.oracle.com/people/mattmn : a lot of stuff from his Java removal script
  :: Version:       1.8.0 ! BUG FIX:     Fix uncommon failure where JRE uninstallers fail because they can't find certain files. Thanks to /u/GoogleDrummer
  ::                      * IMPROVEMENT: Import logging function used in Tron and convert all double "echo" statements to log calls
  ::                      * COMMENTS:    Minor comment cleanup
  ::                1.7.2 * IMPROVEMENT: Add section to remove leftover symlinks in PATH folder to JRE exes. Thanks to /u/turnerf
  ::                1.7.1 * IMPROVEMENT: Remove all /va flags. This had the effect of deleting key values but leaving keys intact, which could break re-installations that thought Java was still installed when in fact it was not. Big thanks to /u/RazorZero
  ::                      * IMPROVEMENT: Reduce 10 JavaSoft registry key deletion commands to 2 by deleting entire JavaSoft key instead of individual subkeys. Thanks to /u/RazorZero
  