Just an alternative to a batch file, you could use...
/run command /c ping
www.mirc.com > ping.txt
And if you wanted to read the information as it was being put into the file, you could set up a simple script that checked a file for new text from the last time it was checked, using say a counter for how many lines there were in the output file the last time, compared to how many lines there are now, etc.