Thanks for looking into my query.
I have a batch script to install java and I am using the below commands to capture JAVA_HOME and JRE_HOME paths. But, I see an error in reg query. Could you please help me with it.
Commands I am using:
set KeyName1=HKEY_LOCAL_MACHINE\SOFTWARE\JavaSoft\Java Runtime Environment
set Cmd=reg query "%KeyName1%" /s
for /f "tokens=2*" %%i in ('%Cmd% ^| findstr "JavaHome"') do set JRE_HOME=%%i
for /f "tokens=2*" %%a in ('reg.exe query "HKLM\Software\JavaSoft\Java Development Kit" /v "Path" ^| find /i "Path"') do echo JAVA_HOME=%%a
Error: ERROR: The system was unable to find the specified registry key or value.
Thanks.