<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	>

<channel>
	<title>ajgraham.com &#187; install</title>
	<atom:link href="http://www.ajgraham.com/tag/install/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.ajgraham.com</link>
	<description>web design, development and consultation in Prague</description>
	<lastBuildDate>Fri, 02 Jul 2010 21:55:51 +0000</lastBuildDate>
	<generator>http://wordpress.org/?v=2.9.2</generator>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
			<item>
		<title>Checking Java version and installing via batch file/command line</title>
		<link>http://www.ajgraham.com/2009/12/checking-java-version-and-installing-via-batch-filecommand-line/</link>
		<comments>http://www.ajgraham.com/2009/12/checking-java-version-and-installing-via-batch-filecommand-line/#comments</comments>
		<pubDate>Tue, 08 Dec 2009 17:07:39 +0000</pubDate>
		<dc:creator>alex</dc:creator>
				<category><![CDATA[General IT]]></category>
		<category><![CDATA[batch file]]></category>
		<category><![CDATA[check]]></category>
		<category><![CDATA[command line]]></category>
		<category><![CDATA[install]]></category>
		<category><![CDATA[Java]]></category>
		<category><![CDATA[script]]></category>
		<category><![CDATA[version]]></category>

		<guid isPermaLink="false">http://www.ajgraham.com/?p=200</guid>
		<description><![CDATA[Unusual situation the other day. I got asked to add an Intranet page with a guide to explain how end users can check the version (or versions) of Java they have installed. I thought to myself there has to be a better and more efficient way of doing this, and [...]]]></description>
			<content:encoded><![CDATA[<p>Unusual situation the other day. I got asked to add an Intranet page with a guide to explain how end users can check the version (or versions) of Java they have installed. I thought to myself there has to be a better and more efficient way of doing this, and making it easier for the end user at the same time.</p>
<p><strong>First</strong> I had the idea of pointing them to the official Java install test page at <a href="http://www.java.com/en/download/help/testvm.xml">Sun Micro</a>, or the more detailed and thorough page over at <a href="http://www.javatester.org/version.html">http://www.javatester.org/version.html</a>. I thought this was a decent solution, until I found out that if a user has more than 1 version of Java installed then a users Web browser can be set to use a different version of Java than the one that might be getting used for other applications.</p>
<p><strong>Second</strong> solution was to use a batch file that would show all versions of Java that were installed on a machine:</p>
<blockquote><p>
java -version<br />
pause
</p></blockquote>
<p>This worked fine I thought. Just create a batch file, put it on an accessible network source and fire round an email with a link to it.</p>
<p><strong>Third</strong> solution. I spoke to a friend who is great with Desktop Support/Windows/etc. He managed to write a script that checks the specific version of Java that was needed (in this case jre-1_5_0_18-windows-i586-p.exe) and if its not installed, installs it from a network resource.</p>
<blockquote><p>
@Echo off<br />
cls<br />
Echo Installing Java 1.5.0_18, Please be patient</p>
<p>set temp_file_a=c:\temp_a.txt<br />
set net2=0<br />
if exist %temp_file_a%  del %temp_file_a% echo clear temp file</p>
<p>rem get java installations<br />
regedit /e %temp_file_a% &#8220;HKEY_LOCAL_MACHINE\SOFTWARE\JavaSoft\Java Plug-in\1.5.0_18&#8243;<br />
if exist %temp_file_a% set net2=1<br />
echo checked registry</p>
<p>if %net2% == 0  echo Java 1.5.0_18 Not Installed if %net2% == 1  echo Java 1.5.0_18 Already Installed if %net2% == 1  goto ta05 echo.<br />
echo Installing Java 1.5.0_18. Please be patient \\&#8221;jre-1_5_0_18-windows-i586-p.exe&#8221; /passive<br />
:ta05</p>
<p>if exist %temp_file_a%  del %temp_file_a% cls Echo Java 1.5.0_18 Installed.<br />
pause
</p></blockquote>
<p> This got rolled out via a run once group policy for the 400 users required. From Web Developer to Desktop Support in 3 easy steps <img src='http://www.ajgraham.com/wp-includes/images/smilies/icon_wink.gif' alt=';)' class='wp-smiley' /> </p>
]]></content:encoded>
			<wfw:commentRss>http://www.ajgraham.com/2009/12/checking-java-version-and-installing-via-batch-filecommand-line/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>
