Dark Horse programmer-are you still worried about re-configuring environment variables after reinstalling the system ?, Dark Horse environment variable
Now let's share the method for configuring environment variables in the next batch!
@ Echo off
Title JDK and Tomcat environment variable settings
Color 0a
Set/p inputplugin = [enter the JDK installation directory you want to set:]
If/I "% input0000%" = "" set input0000= % Java_Home %
Set/p inputTH = [enter the Tomcat installation directory you want to set:]
If/I "% inputTH %" = "" set inputTH = % Tomcat_Home %
Echo is configuring environment variables. Please wait ......
Reg add "HKCU \ Environment"/v Java_Home/t reg_sz/d "% input%%"/f
Reg add "HKCU \ Environment"/v Tomcat_Home/t reg_sz/d "% inputTH %"/f
Reg add "HKCU \ Environment"/v ClassPath/t reg_sz/d ".; "% Java_Home % \ lib \ dt. jar ";" % Java_Home % \ lib \ tools. jar "/f
Reg add "HKCU \ Environment"/v Path/t reg_sz/d "% Java_Home % \ bin """; "% Tomcat_Home % \ bin" ";"/f
Pause
Cls
Echo
Set/p tmp = operation ended. Press enter to exit...
Pause> nul
Copy and save the above Code as a file suffixed with. bat. If your system has been configured, do not try it out!