08-08-2012, 09:18 AM
(This post was last modified: 08-08-2012, 09:28 AM by montcer9012.)
Yeah, like that. Thanks.
Copy this, paste on a notepad and save like "something_x64.bat". Execute it on desktop and then two files will be generated; attach here: Java_Result_x64.reg / test_result_x64.txt
Do exact but name it like "something_x86.bat" attaching files _x86:
Copy this, paste on a notepad and save like "something_x64.bat". Execute it on desktop and then two files will be generated; attach here: Java_Result_x64.reg / test_result_x64.txt
Code:
@echo off
set PATH=%PATH%;lib\;lib\windows-amd64\
if NOT EXIST "%SystemRoot%\SysWOW64" goto JAVA32
if "%ProgramFiles%" == "%ProgramFiles(x86)%" goto JAVA32SHELL
set key=HKEY_LOCAL_MACHINE\SOFTWARE\JavaSoft\Java Runtime Environment
set JAVA_VERSION=
set JAVA_HOME=
for /f "tokens=3* skip=2" %%a in ('reg query "%key%" /v CurrentVersion') do set JAVA_VERSION=%%a
for /f "tokens=2* skip=2" %%a in ('reg query "%key%\%JAVA_VERSION%" /v JavaHome') do set JAVA_HOME=%%b
echo "%JAVA_HOME%">test_result_x64.txt
echo "%JAVA_VERSION%">>test_result_x64.txt
REG EXPORT "%key%" Java_Result_x64.reg
GOTO END
:JAVA32
echo Unable to run a 64bit build on a 32bit platform. Install a 64bit version of Windows first.
pause
goto END
:JAVA32SHELL
echo Unable to properly run a 64bit application from a 32bit context on a 64bit platform.
pause
goto END
:END
pause
Do exact but name it like "something_x86.bat" attaching files _x86:
Code:
@echo off
set PATH=%PATH%;lib\;lib\windows-x86\
if NOT EXIST "%SystemRoot%\SysWOW64" goto JAVA32
set key=HKEY_LOCAL_MACHINE\SOFTWARE\Wow6432Node\JavaSoft\Java Runtime Environment
goto JAVA
:JAVA32
set key=HKEY_LOCAL_MACHINE\SOFTWARE\JavaSoft\Java Runtime Environment
:JAVA
set JAVA_VERSION=
set JAVA_HOME=
for /f "tokens=3* skip=2" %%a in ('reg query "%key%" /v CurrentVersion') do set JAVA_VERSION=%%a
for /f "tokens=2* skip=2" %%a in ('reg query "%key%\%JAVA_VERSION%" /v JavaHome') do set JAVA_HOME=%%b
echo "%JAVA_HOME%">test_result_x86.txt
echo "%JAVA_VERSION%">>test_result_x86.txt
REG EXPORT "%key%" Java_Result_x86.reg
pause