@echo off title JDK和tuxedo环境变量设置 color 0a set /p inputTUX= [请输入你要设置的tuxedo的安装目录:] if /i "%inputTUX%"=="" set inputJH=%TUXDIR% set /p inputJDK= [请输入你要设置的JDK的安装目录:] if /i "%inputJDK%"=="" set inputJDK=%JAVA_HOME% echo 正在配置环境变量,请稍候...... reg add "HKEY_LOCAL_MACHINESYSTEMControlSet001ControlSession ManagerEnvironment" /v DDD /t REG_EXPAND_SZ /d "%inputTUX%" /f reg add "HKEY_LOCAL_MACHINESYSTEMControlSet001ControlSession ManagerEnvironment" /v EEE /t REG_EXPAND_SZ /d "%inputJDK%" /f for,/f,"skip=4 tokens=1,2,*",%%a,in,('reg query "HKEY_LOCAL_MACHINESYSTEMControlSet001ControlSession ManagerEnvironment" /v PATH'),do,( reg add "HKEY_LOCAL_MACHINESYSTEMControlSet001ControlSession ManagerEnvironment" /v AAA /t REG_EXPAND_SZ /d "%%c;"%%TUXDIR%%lib"";""%%TUXDIR%%in"";""%%JAVA_HOME%%"";""%%JAVA_HOME%%in"" /f ) reg add "HKEY_LOCAL_MACHINESYSTEMControlSet001ControlSession ManagerEnvironment" /v bbb /t REG_EXPAND_SZ /d ".;"%%JAVA_HOME%%lib"";""%%JAVA_HOME%%libcomm.jar"" /f reg add "HKCUEnvironment" /v CCC /t reg_sz /d "//192.168.101.81:7001" /f set /p tmp=环境变量设置成功,请按回车键退出... pause>nul
保存为 :.bat