Hi,
I am installing JDK silently from batch file. So, after installation of JDK completed successfully, I want to add path of JDK\bin to the environment variable (path).
I am using set path command to set the path, but it accepts the java command till the session of that batch file. But, I want to set the path of JDK to the path variable, permanently.
Is there any way to do this?
Thanks in advance,
JSF GEEKS
set path variable permanently from batch file.
Moderator: DosItHelp
-
- Expert
- Posts: 391
- Joined: 19 Mar 2009 08:47
- Location: Iowa
Re: set path variable permanently from batch file.
setx perhaps?
Re: set path variable permanently from batch file.
Have a look to the registry:
HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\Session Manager\Environment
REG ADD could help you. Something like:
HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\Session Manager\Environment
REG ADD could help you. Something like:
Code: Select all
REG ADD "HKLM\SYSTEM\CurrentControlSet\Control\Session Manager\Environment" /v "Path" /t "REG_MULTI_SZ" /d "%path%;C:\Program Files\java\jdkXXX\bin" /f