Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations gkittelson on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

registry

Status
Not open for further replies.

mg911

Technical User
Jul 18, 2001
59
US


is there a way to check the registry to see if the java virtual machine has been installed



 
Hello, mg911.

There sure is a way(s) to read it out from the registry and with vbs. But, I would start with an easy commandline before the script which reveals also one place where the info is stored in the registry.

[1] Cmdline
Click out Start | Run and enter:
WJview <hard enter>
Or, open the command prompt window and enter:
Jview <hard enter>
You'll see the version displayed.

[2] vbs
The script below does the job as requested.

'---------jvm.vbs--------/tsuji/-----
Option Explicit

Const clsid = &quot;{08B0E5C0-4FCB-11CF-AAA5-00401C608500}&quot;
Const parent = &quot;HKEY_LOCAL_MACHINE\Software\CLASSES\CLSID&quot;
Const child = &quot;InstalledVersion&quot;
Const errmsg = &quot;Microsoft Java VM is not installed in your machine.&quot;

Dim key, wsh, version_number, msg
key = parent & &quot;\&quot; & clsid & &quot;\&quot; & child & &quot;\&quot;
Set wsh = CreateObject(&quot;WScript.Shell&quot;)
On Error Resume Next
version_number = wsh.RegRead(key)
If Err<>0 Then
msg = errmsg
Else
msg = &quot; The installed Microsoft Java VM is of version : &quot; & version_number
End If
Err.Clear
On Error Goto 0
WScript.Echo msg
set wsh = Nothing
WScript.Quit
'---------jvm.vbs--------/tsuji/-----

regards - tsuji
 
thanks a lot - one more question - is there anyway to point the user to a site or somewhere if they dont have the virtual machine installed on their computer????

Thanks for your help a lot
 
Hello again.

It usually comes with MSIE. MS also makes it available for download as an independent module : (build 3802)


Care to download the right version. MS makes a frightening statement that &quot;Once installed, the Microsoft VM cannot be uninstalled.&quot;

regards - tsuji
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top