Put this at the top of your batch file:
setlocal enabledelayedexpansion
Then inside the for loop replace %_classpath% with !_classpath!
Without deferred extension, %_classpath% expands once, at the beginning of the for loop.
[Edit] In response to the comment here is a complete list of codes
@echo off setlocal enabledelayedexpansion set _classpath=. for %%i in (%1/lib/*.*) do ( set _classpath=!_classpath!;%%i ) echo %_classpath% pause
BlueRaja - Danny Pflughoeft
source share