You'll need to output some stuff that is known to your script; things it'll be looking for. An example:
Batch code:
ECHO !BEGINBATCH! >> Output.txt
@ECHO OFF
ECHO !ENDCOMMAND! >> Output.txt
ipconfig /all >> Output.txt
ECHO !ENDCOMMAND! >> Output.txt
DIR C:\ >> Output.txt
ECHO !ENDCOMMAND! >> Output.txt
ECHO !ENDBATCH! >> Output.txt
Then have the script load the file and search for "!BEGINBATCH!", "!ENDCOMMAND!" and "!ENDBATCH!".
NB you'll need to know where Output.txt is located. I don't really know where you'll find it; you'll need to experiment with that.