Photo Gallery Member List Search Calendars FAQ Ticket List Log Out


JREVersion

 
Logged in as: Guest
arrSession:exec spGetSession 2,2,31528
 Active Users: There are 0 members and 0 guests.
 Users viewing this topic: none
 

 

 
  
  Printable Version
All Forums >> [Scripting] >> WSH & Client Side VBScript >> JREVersion
  Do you like VisualBasicScript.com? Link to us and help spread the word about our forum. Thanks!
Page: [1]
Login
Message << Older Topic   Newer Topic >>
 JREVersion - 2/24/2006 5:47:08 PM   
  bistmaster

 

Posts: 10
Score: 0
Joined: 2/24/2006
Status: offline
Hey guys...Good day!? need help.How to check the Java Runtime installed on a computer using vbscript.

i only had knew one function [object.JREVersion]. Yet i dont know wat do object is [obect] how to create.

Thank so much...

_____________________________

Bistmaster
Web Developer / Programmer
 
 
Post #: 1
 
 RE: JREVersion - 2/25/2006 5:08:40 AM   
  Cybex


Posts: 412
Score: 0
Joined: 9/14/2005
From: Florida
Status: offline
I have no idea what "object.jreversion" is, I have never seen it before and searches turned up nothing for VBScript. 

You could try using the coomandline "java -version" as a starting point.

Cybex

_____________________________

Common sense is not so common.

(in reply to bistmaster)
 
 
Post #: 2
 
 RE: JREVersion - 2/26/2006 12:38:44 PM   
  bistmaster

 

Posts: 10
Score: 0
Joined: 2/24/2006
Status: offline
Good day!

Got it!...thanks.
About the object.jreversion is supposed to be object.minimumjreversoion. you can the link below.

http://www.ephox.com/developers/editliveforjava/v40/html/prop_minimumjreversion.html

Anyway, Thanks cybex...




_____________________________

Bistmaster
Web Developer / Programmer

(in reply to Cybex)
 
 
Post #: 3
 
 RE: JREVersion - 2/27/2006 12:54:28 AM   
  mbouchard


Posts: 1922
Score: 16
Joined: 5/15/2003
From: USA
Status: offline
Would require a little checking for the correct folder, but you could use java.exe -version to get the JRE version. 

On my PC , c:\program files\Java\j2re1.4.2\bin\java.exe gives me something like

java version "1.4.2"
java(tm) 2 Runtime Environemtn, Standard Edition )build 1.4.2-b28)
Java HotSpot(tm) Client VM (build 1.4.2-b28, mixed mode)

You can possibly find this path via the reg key found in HKCR\applications\javaw.exe\shell\open\command\(default)

Not positive if this key will be present for all versions, also, you would want to use java.exe and not javaw.exe as javaw doesn't give you anything or so it seems.

_____________________________

Mike

For useful Scripting links see the Read Me First stickey!

Always remember Search is your friend.

(in reply to bistmaster)
 
 
Post #: 4
 
 RE: JREVersion - 2/27/2006 1:21:00 AM   
  Cybex


Posts: 412
Score: 0
Joined: 9/14/2005
From: Florida
Status: offline
I thought that is what I said two days ago...

Also "java" should be in path and all you should have to do is type "java -version".

Cybex

_____________________________

Common sense is not so common.

(in reply to mbouchard)
 
 
Post #: 5
 
 RE: JREVersion - 2/27/2006 1:34:06 AM   
  mbouchard


Posts: 1922
Score: 16
Joined: 5/15/2003
From: USA
Status: offline
quote:

ORIGINAL: Cybex

I thought that is what I said two days ago...

Also "java" should be in path and all you should have to do is type "java -version".

Cybex

Hmm, Note to self, read read read.

_____________________________

Mike

For useful Scripting links see the Read Me First stickey!

Always remember Search is your friend.

(in reply to Cybex)
 
 
Post #: 6
 
 RE: JREVersion - 2/27/2006 12:46:34 PM   
  bistmaster

 

Posts: 10
Score: 0
Joined: 2/24/2006
Status: offline
hey guys!

I've constructed a code which can check the version. It will scan thru control panel-add/remove new programs. I just wanna if its accurate?


Function checkVersion()

 appName = "Java"
 appName2 = "J2SE R"
 strProdList = ""
 Set msiObject = Wscript.CreateObject("WindowsInstaller.Installer")
 For Each msiProduct In msiObject.Products
 if left(msiObject.ProductInfo(msiProduct, "ProductName"),6) = appName2 then
         checkVersion = msiObject.ProductInfo(msiProduct, "ProductName")
    elseif left(msiObject.ProductInfo(msiProduct, "ProductName"),4) = appName then
  checkVersion = msiObject.ProductInfo(msiProduct, "ProductName")
 END IF
 Next
 
End Function

Thanks

_____________________________

Bistmaster
Web Developer / Programmer

(in reply to bistmaster)
 
 
Post #: 7
 
 RE: JREVersion - 2/27/2006 2:40:23 PM   
  Cybex


Posts: 412
Score: 0
Joined: 9/14/2005
From: Florida
Status: offline
I have no idea if this is the best way to do this or not but at least use the function as one, otherwise just use the code inline.  See if this still meets your needs.


      


Cybex

_____________________________

Common sense is not so common.

(in reply to bistmaster)
 
 
Post #: 8
 
 RE: JREVersion - 2/27/2006 4:26:17 PM   
  bistmaster

 

Posts: 10
Score: 0
Joined: 2/24/2006
Status: offline
Thank so much cybex...

Thats a better way to code.

:)

_____________________________

Bistmaster
Web Developer / Programmer

(in reply to bistmaster)
 
 
Post #: 9
 
 
 
  

If you found our site useful please link to us <a href="http://www.visualbasicscript.com">VisualBasicScript.com</a>.
All Forums >> [Scripting] >> WSH & Client Side VBScript >> JREVersion Page: [1]
Jump to:





New Messages No New Messages
Hot Topic w/ New Messages Hot Topic w/o New Messages
Locked w/ New Messages Locked w/o New Messages
 Post New Thread
 Reply to Message
 Post New Poll
 Submit Vote
 Delete My Own Post
 Delete My Own Thread
 Rate Posts