Photo Gallery Member List Search Calendars FAQ Ticket List Log Out


VBS to check Java Version

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

 

 
  
  Printable Version
All Forums >> [Scripting] >> WSH & Client Side VBScript >> VBS to check Java Version
  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 >>
 VBS to check Java Version - 5/6/2008 12:08:33 AM   
  gcibirch

 

Posts: 4
Score: 0
Joined: 5/6/2008
Status: offline
Hi,

Does anyone have a script or can tell me the commands to search the local hard drive for the version of Java. Then output the results to a file that is named after the computer that is scanned.

Sorry my vb skills are limited.

Thanks
 
 
Post #: 1
 
 RE: VBS to check Java Version - 5/6/2008 12:31:44 AM   
  ebgreen


Posts: 4613
Score: 31
Joined: 7/12/2005
Status: offline
Search this forum and google.

_____________________________

"... when you are good and crazy, oooh, oooh, oooh, the sky is the limit!" - The Tick
Goog places to start:http://www.visualbasicscript.com/m_24727/tm.htm
http://www.visualbasicscript.com/m_47117/tm.htm

(in reply to gcibirch)
 
 
Post #: 2
 
 RE: VBS to check Java Version - 5/6/2008 12:37:01 AM   
  gcibirch

 

Posts: 4
Score: 0
Joined: 5/6/2008
Status: offline
Thanks

I already have and can find snippets.............but not to sure it will work

(in reply to ebgreen)
 
 
Post #: 3
 
 RE: VBS to check Java Version - 5/6/2008 12:38:20 AM   
  ebgreen


Posts: 4613
Score: 31
Joined: 7/12/2005
Status: offline
So try them and see if they do. We are happy to help you write a script. We are not so happy to write it for you. Write something and try it then post what you have and explain how it fails.

_____________________________

"... when you are good and crazy, oooh, oooh, oooh, the sky is the limit!" - The Tick
Goog places to start:http://www.visualbasicscript.com/m_24727/tm.htm
http://www.visualbasicscript.com/m_47117/tm.htm

(in reply to gcibirch)
 
 
Post #: 4
 
 RE: VBS to check Java Version - 5/6/2008 12:40:12 AM   
  gcibirch

 

Posts: 4
Score: 0
Joined: 5/6/2008
Status: offline
ok fair enough

(in reply to ebgreen)
 
 
Post #: 5
 
 RE: VBS to check Java Version - 5/6/2008 8:32:39 PM   
  gcibirch

 

Posts: 4
Score: 0
Joined: 5/6/2008
Status: offline
OK,

Found this script for checking the version of Java. It works and prints the version to the screen.

Set objFSO = CreateObject("Scripting.FileSystemObject")
Set objShell = CreateObject("WScript.Shell")
Set envProcess = objShell.Environment("process")
windir = envProcess.Item("windir")
rtnVersion = objFSO.GetFileVersion(windir & "\system32\java.exe")
Set objFSO = Nothing
WScript.Echo "Java Version: " & rtnVersion

But now I want to output the results to a text file and base the file name on the name of the computer. So I added to the end:

> c:\&COMPUTERNAME&.txt

but all I get is "expected statement at 7, 48". Tried it with % but still doesnt work any help would be great.

Thanks
Lee

(in reply to gcibirch)
 
 
Post #: 6
 
 RE: VBS to check Java Version - 5/6/2008 10:38:52 PM   
  mbouchard


Posts: 1835
Score: 14
Joined: 5/15/2003
From: USA
Status: offline
Take a look at the WSH help docs, found in the readme post, and look at WriteLine.

_____________________________

Mike

For useful Scripting links see the Read Me First stickey!

Always remember Search is your friend.

(in reply to gcibirch)
 
 
Post #: 7
 
 RE: VBS to check Java Version - 5/6/2008 10:44:40 PM   
  Rischip


Posts: 414
Score: 2
Joined: 3/26/2007
Status: offline
Java can reside many places. "System32", "program files\java", "program files\javasoft", or any other directory if it was installed with an application. It really depends what you are looking for as to what is going to work.
If I type Java -version at the command line, I get 1.5.0, but the Plug-in that is installed in the browser is 1.4.2_12. You can have simultaneous installs to do different things.

My Plugin resides C:\Program Files\Java\j2re1.4.2_12\bin\npjpi142_12.dll
The default Java version resides in both "c:\windows\system32" as well as "C:\Program Files\Java\jre1.5.0\bin" which also contains plug-ins for the browser, but 1.4.2 was installed after to override 1.5.0 settings, since 1.5.0 and after installs rewrite every other versions registry entries to point to itself.

This one should be fun.

_____________________________

Rischip
Author of - The Grim Linker

(in reply to gcibirch)
 
 
Post #: 8
 
 
 
  

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 >> VBS to check Java Version 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