Development environment to set up a lot of environment variables each time, generally through the "menu", "Computer", "Properties", "Environment variables" and "Settings", re-install the system, each time to set a lot of environment variables, very troublesome. You can actually set the environment variable by modifying the registry, and set it up once with the bat script.
First set the user environment variable to Path =%devpaths%;
Create a bat script that adds the bin directory of tools such as Java, Maven, and so on to%devpaths%.
SetEnv.bat
REG ADD "hkcu\environment"/f/t reg_sz/v java_home/d "D:\dev\jdk8_32""hkcu\environment"/f/t reg_sz/v Mvn_ho me/d "D:\dev\maven""hkcu\environment"/f/t reg_sz/v ant_home/d "D:\dev\ant""Hkcu\environment"/f/t reg_sz/v gradle_home/d "D:\dev\gradle-3.4.1""hkcu\environment"/f/t reg_sz/v groovy_home/d "D:\dev\groovy" c4>"hkcu\environment"/f/t reg_sz/v erlang_home/d "C:\Program files\erl9.2""hkcu\environment"/f/t REG_ expand_sz/v devpaths/d "%java_home%\bin;%mvn_home%\bin;%ant_home%\bin;%groovy_home%\bin;%gradle_home%\bin;% Erlang_home%\bin "
Modify the values in the registry by using the Reg command. The user's environment variables are under Hkcu\enviroment, HKCU represents Key_current_user.
Values with a percent reference need to set the/T REG_EXPAND_SZ type so that Chengxiang strings can be expanded, such as the devpaths above.
Setting Windows environment variables by modifying the registry