CPressland Posted January 17, 2013 Share Posted January 17, 2013 Hey, I'm currently working on migrating versions of Java to the latest build and am currently trying to do some custom reporting back to my Inventory Server; currently on OS X I'm running a shell script which looks like this: /Library/Internet\ Plug-Ins/JavaAppletPlugin.plugin/Contents/Home/bin/java -version 2>&1 | grep "java version" | awk '{print $3}' | sed -e "s/\"//g"[/CODE] This exports code which looks like this: So what I need is a Batch Script which will do the exact same on Windows. Any ideas? Link to comment Share on other sites More sharing options...
CPressland Posted January 18, 2013 Author Share Posted January 18, 2013 Just in case anybody in the future needs this: @echo offsetlocalset VERSION6="1.6.0_21"for /f "tokens=3" %%g in ('java -version 2^>^&1 ^| findstr /i "version"') do (set JAVAVER=%%g)set JAVAVER=%JAVAVER:"=%@echo %JAVAVER%endlocal@exit %JAVAVER%[/CODE] Link to comment Share on other sites More sharing options...
Recommended Posts