set CLASSPATH= for %%i ("..\mydir\lib\*.jar") do call :append "%%i" :append set CLASSPATH=%CLASSPATH%;%1 goto :eof