批处理for循环加入jar到CLASSPATH

main.bat

 1 @echo off
 2 set CLASSPATH=D:\.Lab\classes
 3 pushd ".\lib"
 4 for %%i in ("*.jar") do call :appendcp "%cd%\%%i"
 5 popd
 6 echo CLASSPATH=%CLASSPATH%
 7 pause
 8 exit
 9 
10 :appendcp
11 for /f "tokens=*" %%v in (%1) do set CLASSPATH=%CLASSPATH%;%%v
12 goto :eof

 

转载于:https://www.cnblogs.com/rms365/p/10961557.html

你可能感兴趣的:(批处理for循环加入jar到CLASSPATH)