I write a bat script to set java path in envirnment variable. I use following command to set path -
setx PATH=%jdkDirDest%\bin;%PATH%.
setx PATH=%playDirDest%;%PATH%.
set PATH=%jdkDirDest%\bin;%PATH%.
set PATH=%playDirDest%;%PATH%.
It works fine when I am working with current session But what happen if I closed current command prompt and again open and run following command
java -version
javac etc.
It shows no java version is intall in this system
Can any one sugest me what code I use to set these environment path permanently to my matchine using bat command.
** I need bat command.
You have to use setx without the '=', and set with it. Also use quotes for the values of the environment variables
setx PATH "%jdkDirDest%\bin;%PATH%"
setx PATH "%playDirDest%;%PATH%"
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With