I'd like to check the installed Java Version on different Windows Server. There is a simple way to do it in a batch file:
java -version
To be able to use the output in PRTG I have a .bat file with the following content:
for /f "tokens=3" %%g in ('java -version 2^>^&1 ^| findstr /i "version"') do (
set JAVAVER=%%g
)
set JAVAVER=%JAVAVER:"=%
set JAVAVER=%JAVAVER:_=%
set JAVAVER=%JAVAVER:.=%
echo %JAVAVER%:%JAVAVER%
This works fine for me on local or remote probes. How can I use the .bat file on other Servers where no probe is installed?
I had no success with PsExec. WMI doesn't work for us as well, as we installed Java through Server JRE.
Add comment