@echo off if errorlevel 0 ( FOR /d %%i in (mod_*) DO ( cd %%i FOR %%j in (*.xml) DO ( echo %%j echo processing %%~fj call ..\..\Tool\spgen.bat %%~fj ) cd.. ) )