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.
Const clsid = "{08B0E5C0-4FCB-11CF-AAA5-00401C608500}"
Const parent = "HKEY_LOCAL_MACHINE\Software\CLASSES\CLSID"
Const child = "InstalledVersion"
Const errmsg = "Microsoft Java VM is not installed in your machine."
Dim key, wsh, version_number, msg
key = parent & "\" & clsid & "\" & child & "\"
Set wsh = CreateObject("WScript.Shell"
On Error Resume Next
version_number = wsh.RegRead(key)
If Err<>0 Then
msg = errmsg
Else
msg = " The installed Microsoft Java VM is of version : " & version_number
End If
Err.Clear
On Error Goto 0
WScript.Echo msg
set wsh = Nothing
WScript.Quit
'---------jvm.vbs--------/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????
This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
By continuing to use this site, you are consenting to our use of cookies.