I'm trying to determine where is located Java provided by Oracle on machine. I have several location where java is located but my script should be able to find appropriate (Oracle Java) version using simple script:
{$java_location}/bin/java.exe -XshowSettings:properties -version | findstr java.vendor | findstr oracle
This should return empty output when not Oracle Java and some text when it's the right one. Unfortunately VBScript hangs up when calling this commands.
Set oExec = WSHShell.Exec({$java_location}/bin/java.exe -XshowSettings:properties -version | findstr java.vendor | findstr oracle > " & "c:\Users\J33nn\testscript")
Do While oExec.Status = 0
WScript.Sleep 100
Loop
Is there any way to run this and prevent script from hanging? Or any other way to run this command from VBS script?