Now share the next batch configuration environment variable method, a key to get it done!
@echo off
title JDK and Tomcat environment variable settings
Color 0a
set/p inputjh= [Please enter the installation directory of the JDK you want to set up:]
if/i "%inputjh%" = = "" Set inputjh=%java_home%
set/p inputth= [Please enter the installation directory of Tomcat 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 "%inputjh%"/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 ends, press ENTER to exit ...
Pause>nul
Copy the above code and save it as a file with a. bat suffix and don't try it if your system is already configured!
Dark Horse Programmer-is it still troubling to reconfigure environment variables after reloading the system?