Remotely and Silently Update Java on Windows 7, 8, & 10

code1

Keeping Java updated in the enterprise network can be difficult because of the frequencies of updates released. This script removes any old versions installed and then installs version 8.77. It also turns off auto updating.

You need to download the offline Java installer and then edit Java32 and Java64 variables for your environment. I have tested and used this script with Java version 8.77. Future builds may need tweaks. Happy Updating!

Code:

@ECHO OFF

set Java32=“\\NETWORK LOCATION\jre-8u77-windows-i586.com”
set Java64=“\\NETWORK LOCATION\jre-8u77-windows-x64.com”

goto uninstall

:uninstall
@ECHO OFF
cls

wmic product where “name like ‘Java 7%%'” call uninstall /nointeractive
wmic product where “name like ‘JavaFX%%'” call uninstall /nointeractive
wmic product where “name like ‘Java(TM) 7%%'” call uninstall /nointeractive
wmic product where “name like ‘Java(tm) 6%%'” call uninstall /nointeractive
wmic product where “name like ‘J2SE Runtime Environment%%'” call uninstall /nointeractive
wmic product where “name like ‘Java 8%%'” call uninstall /nointeractive
wmic product where “name like ‘Java(TM) 8%%'” call uninstall /nointeractive

if not exist %Java32% set missing=%Java32% & goto Julia1
if not exist %Java64% set missing=%Java64% & goto Julia1

IF NOT DEFINED PROCESSOR_ARCHITEW6432 (
IF %PROCESSOR_ARCHITECTURE% EQU x86 (
goto JA32
) ELSE (
goto JA64
)) ELSE (
goto JA64
)
:JA64
cls
title Installing Java x64
echo Installing Java x64. . .
%Java64% INSTALL_SILENT=1 STATIC=0 REBOOT=0 AUTO_UPDATE=0 EULA=0 WEB_ANALYTICS=0 WEB_JAVA=1

REM Disable Java Update Tab and also Updates and Notifications
reg add “HKLM\SOFTWARE\JavaSoft\Java Update\Policy” /v EnableJavaUpdate /t REG_DWORD /d 00000000 /f
reg add “HKLM\SOFTWARE\JavaSoft\Java Update\Policy” /v EnableAutoUpdateCheck /t REG_DWORD /d 00000000 /f
reg add “HKLM\SOFTWARE\Wow6432Node\JavaSoft” /v SPONSORS /t REG_SZ /d DISABLE /f
goto JA32

:JA32
cls
title Installing Java x86
echo Installing Java x86. . .

%Java32% INSTALL_SILENT=1 STATIC=0 REBOOT=0 AUTO_UPDATE=0 EULA=0 WEB_ANALYTICS=0 WEB_JAVA=1

REM Disable Java Update Tab and also Updates and Notifications
reg add “HKLM\SOFTWARE\JavaSoft\Java Update\Policy” /v EnableJavaUpdate /t REG_DWORD /d 00000000 /f
reg add “HKLM\SOFTWARE\JavaSoft\Java Update\Policy” /v EnableAutoUpdateCheck /t REG_DWORD /d 00000000 /f
reg add “HKLM\SOFTWARE\JavaSoft” /v SPONSORS /t REG_SZ /d DISABLE /f

goto END

:Julia1
cls
echo Bad Path
echo.
goto END

:END
exit

You can download a text file with the code here: java2

Show IT staff Availability on Intranet or Website

PHP

This easily shows which IT staff members are available on your Intranet or website. Use the PHP code below and tweak the AIM name and your contact information for your needs.
You need access to a web server with PHP installed and an AIM account on your PC or smartphone. When you set your AIM status to available or invisible your users can see this dynamically on your site. If you install AIM on your smart phone you can set your status anywhere you go. Use this to have a peaceful day off or a quiet lunch and direct support calls to the person working. It also helps eliminate end user stress because they can now quickly see who is available.

Code:

See who is available in IT: (Be sure to refreash this page for current infomation!)

<?PHP
$screenNamerp = “billsmith”; // Add your screename to the $screenName variable
// Connect to AOL server
$url = @fsockopen(“big.oscar.aol.com”, 80, &$errno, &$errstr, 3);

// Query the Server
fputs($url, “GET /”.$screenNamerp.”?on_url=online&off_url=offline HTTP/1.0\\n\\n”);

// See resultant page
while(!feof($url)){
$feofi++;
$page .= fread($url,256);
if($feofi > 10){
$page = “offline”;
break;
}
}
fclose($url); // Close the connection to big.oscar.aol.com
// determine online status
if(strstr($page, “online”)){
echo ‘Bill Smith is available at Ext. 111 or 312-555-5555’;
}else{
echo ‘Bill Smith is unavailable at this time.’;
}
$page = ”;
$url = ”;
?>
<br>
<br>
<?PHP
$screenNameaf = “janesmith”; // Add your screename to the $screenName variable
// Connect to AOL server
$url = @fsockopen(“big.oscar.aol.com”, 80, &$errno, &$errstr, 3);

// Query the Server
fputs($url, “GET /”.$screenNameaf.”?on_url=online&off_url=offline HTTP/1.0\\n\\n”);

// See resultant page
while(!feof($url)){
$feofi++;
$page .= fread($url,256);
if($feofi > 10){
$page = “offline”;
break;
}
}
fclose($url); // Close the connection to big.oscar.aol.com
// determine online status
if(strstr($page, “online”)){
echo ‘Jane Smith is available at Ext. 222 or 312-444-1234’;
}else{
echo ‘Jane Smith is unavailable at this time.’;
}
$page = ”;
$url = ”;
?>