@echo off
cd tools
FOR /F "tokens=*" %%G IN (files2recmod.txt) DO (
 IF NOT EXIST %KITCHENPATH%\%%G (
   echo %KITCHENPATH%\%%G doesn't exist!!
   set /a nErrors=nErrors+1
 ) ELSE (
  IF EXIST %KITCHENPATH%\%%G\imageinfo.bin (
   echo Processing module %KITCHENPATH%\%%G...
   call %~dp0module2file.cmd %KITCHENPATH%\%%G
   set /a nModules=nModules+1
  ) ELSE (
   echo Processing package %KITCHENPATH%\%%G...
   call %~dp0package2file.cmd %KITCHENPATH%\%%G
   set /a nPackages=nPackages+1
  ) 
 )
)
echo Processed %nPackages% packages and %nModules% modules
echo Found %nErrors% errors