Property - file contains (pathname of running application "java.exe")

(imported topic written by Don65)

I’m attempting to create a property that does the following:

if exists (running application “java.exe”) then search text file for (pathname of running application “java.exe”) and if found provide from the next line containing (java.version:) the (text following java.version:)

So for example:

Pathname of running application “java.exe” in this scenario is c:\Windows\system32\java.exe

expected output is 1.4.2_01

Here’s the contents of the text file.

EVALUATING C:\Program Files\Java\j2re1.4.1_01\bin\java.exe

java.home: C:\Program Files\Java\j2re1.4.1_01

java.vendor: Sun Microsystems Inc.

java.version: 1.4.1_01

EVALUATING C:\WINDOWS\system32\java.exe

java.home: C:\Program Files\Java\j2re1.4.2_01

java.vendor: Sun Microsystems Inc.

java.version: 1.4.2_01

(imported comment written by BenKus)

Try this:

q: if (not exists file “C:\java.txt” OR not exists running application “java.exe”) then “n/a” else (following texts of firsts "java.version: " of next lines of next lines of next lines of lines whose (it as lowercase contains (pathname of running application “java.exe” as lowercase) ) of file “C:\java.txt”)

Change the file name to whatever file you are looking at… I believe this will only return the results from one of the running java.exe and let me know if you need it adapted to handle multiple java.exe running at the same time.

Ben