Reputation: 35702
Is it possible using a Windows batch file to determine if the version of Java (assuming 7) installed is the 32 bit version or the 64 bit version?
Upvotes: 3
Views: 3211
Reputation: 7706
Here is a small windows script to get you started that will determine Java32 vs Java64 vs JavaNotInstalled.
Tweak as necessary...
@echo off
java -d64 -version >nul 2>&1
if errorlevel 1 goto maybe32bit
echo Java is 64 bit
goto EXIT
:maybe32bit
where java >nul 2>&1
if errorlevel 1 goto nojava
echo Java is 32 bit
goto EXIT
:nojava
echo Java is not installed
:EXIT
Upvotes: 4
Reputation: 691755
Yes, it is possible. The bat file could run java -version
and parse the output.
Upvotes: 0