sample.bat
@echo off for /f tokens^=2-5^ delims^=.-_^" %%j in ('java -fullversion 2^>^&1') do set "javaV=%%m" echo %javaV% pause
The Java version acquisition command is treated as an error output for some reason.
Recommended Posts