First, let's look at the batch.m file to make sure it's what we expect

!! "batch.m"

Now, evaluate the following function definitions.

These definitions will be used to open and evaluate the package, and then write the necessary dialog to the output file.

WritePairs[
        strm_, {HoldForm[in_],  
          out_}, {num_}] := 
WriteString[strm,  "In[", 
        num, "]:=\n",  
        ToString[Unevaluated[in], InputForm], "\n\n",  "Out[",  
        num, "]=\n",  out,  "\n\n"]

EvaluatePackage[infile_,  outfile_] := 
      Module[{strm = OpenWrite[outfile], in, out, 
          pairs}, 
in = 
          ReadList[infile,  HoldForm[Expression]]; 
out = 
          ReleaseHold[in]; 
pairs = 
          Transpose[{in, out}]; 
MapIndexed[
          WritePairs[strm, ##] &, pairs]; 
Close[
          strm]
]

Now, let's try it out.

The function to use is EvaluatePackage. The two arguments it takes are: 1) the input package file, and 2) the designated output file. Please keep in mind that this is an example. You may need to give the full path names in your own use of this function.

EvaluatePackage["batch.m", "batch.out"]

Now, let's look at the resultant output file.

!! "batch.out"