@echo off call "D:\Program Files\Perl\bin\perl.exe" bayes.pl testArgs #bayes.pl will return the output on the screen #I need to pipe that output back into the .bat file and then I've got it from there echo BAYESOUTPUT; >> %1