Write Ping results to a text file

batchping

This should be pretty simple but for some reason, my situation is proving to be a bit tricky…

I want to save the results of a ping to a text file. To do so, I am using the following command in a .bat:

ping X.X.X.X >> ping.txt

When I run this .bat file, the file created (ping.txt) contains hundreds of rows of the input rather than the output:

C:\Documents and Settings\XYZ\Desktop>ping X.X.X.X  1>>ping.txt 

C:\Documents and Settings\XYZ\Desktop>ping X.X.X.X  1>>ping.txt 

C:\Documents and Settings\XYZ\Desktop>ping X.X.X.X  1>>ping.txt 

Anyone have any idea why I'm not getting the results of ping to the text file?

Best Answer

Is your bat file called ping.bat? try renaming it to pong.bat and then run pong.bat!

Related Question