1 ::Windows XP配置
2 set pan=%0
3 set pan=%pan:~1,3%
4 set devenvdir=%pan%DEV_FOR_JEE
5
6 ::windows 7手动输入盘符,放开注释
7 set devenvdir=X:\DEV_FOR_JEE
8
9 wmic ENVIRONMENT where "name='JAVA_HOME'" delete
10 wmic ENVIRONMENT where "name='MVN_HOME'" delete
11 wmic ENVIRONMENT where "name='ClassPath'" delete
12 wmic ENVIRONMENT where "name='M2_REPO'" delete
13 wmic ENVIRONMENT create name="JAVA_HOME",username="<system>",VariableValue="%devenvdir%\java1.6"
14 wmic ENVIRONMENT create name="MVN_HOME",username="<system>",VariableValue="%devenvdir%\maven3.0.4"
15 wmic ENVIRONMENT create name="M2_REPO",username="<system>",VariableValue="%devenvdir%\repository"
16 wmic ENVIRONMENT create name="ClassPath",username="<system>",VariableValue="%JAVA_HOME%\lib\dt.jar;%JAVA_HOME%\lib\tools.jar;%JAVA_HOME%\bin;.;"
17 wmic ENVIRONMENT where "name='Path' and username='<system>'" set VariableValue="%%JAVA_HOME%%\bin;%%MVN_HOME%%\bin;%%M2_REPO%%;%path%"
18 pause
19