VBScript

  • Thread starter Thread starter Rashmi
  • Start date Start date
R

Rashmi

Hi,
I am trying to display the available Jdk version using
following script. If any one can try the code. I am not
able to display the version of Jdk. I am using WSH 5.6.

Script:
-------

Set objShell = CreateObject("WScript.Shell")
set objScriptExec = objShell.exec("C:\3rdparty\jdk1.3.1
\bin\java.exe -version")
strIpConfig = objScriptExec.StdOut.ReadAll
WScript.Echo strIpConfig

Thanks

Rashmi.
 
Maybe, java.exe uses some other method of writing. The following
worked for me:

--
Regards,

Tushar Mehta, MS MVP -- Excel
www.tushar-mehta.com
Excel, PowerPoint, and VBA add-ins, tutorials
Custom MS Office productivity solutions
 
Maybe, Java uses something other than StdOut for writing?

The following VBScript worked for me:

Dim objShell , oExec , rslt
Set objShell = CreateObject("WScript.Shell")
Set oExec = objShell.exec( "c:\test.bat")
'WScript.Echo oExec.Status
Do
rslt = rslt & oExec.StdOut.ReadAll
Loop While Not oExec.StdOut.AtEndOfStream
WScript.Echo oExec.Status
WScript.Echo rslt

test.bat contained an echo command and a dir command.

You may also want to check one of the scripting groups, possibly
scripting.vbscript.

--
Regards,

Tushar Mehta, MS MVP -- Excel
www.tushar-mehta.com
Excel, PowerPoint, and VBA add-ins, tutorials
Custom MS Office productivity solutions
 
Back
Top