Saturday, November 13, 2010

Dos Command to read JDK Path from registry

These lines of code will get the JDK path from registry:


set KeyName=HKEY_LOCAL_MACHINE\SOFTWARE\JavaSoft\Java Development Kit
set Cmd=reg query "%KeyName%" /s
for /f "tokens=2*" %%i in ('%Cmd% ^| find "JavaHome"') do set JVM_HOME=%%j
echo Path is : %JVM_HOMPublish PostE%

No comments: