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