If you want the FoxPor routine to do some stuff first and then have the batch file act on it, you could have FoxPro create a small .BAT file that your original batch file could call (STEP2.BAT).
TEST.BAT contains:
START /w c:\foxprow\foxprow.exe routine.prg
CALL STEP2.BAT
REM Rest of batch file here
/w - says wait until program termination to continue batch file execution.
ROUTINE.PRG contains:
*
*... code to do some processing here ...
STORE 0 TO proc_items
SCAN
proc_items = proc_items + 1
ENDSCAN
*
SET DEVICE TO C:\STEP2.BAT
@ 0,0 say "THE_EXE " + alltrim(str(proc_items))
SET DEVICE TO SCREEN
QUIT
Substitue "THE_EXE" for whatever executable the batch file runs. proc_items is the count of items that processed.