ping google.com >> ping.txt
that dosent work if i put it in a batch file and run the file
this is the output of ping.txt:
C:\Users\User\Desktop>ping google.com 1>>ping.txt
C:\Users\User\Desktop>ping google.com 1>>ping.txt
.
.
.
You're doing something strange with pipes.
This (from command line) will append the ping
result to ping.txt
file.
ping www.google.com >> ping.txt
Now create a batch file (testping.bat
, for example) and put the same line inside it.
If you run the batch file with following command you'll get the same result.
testping
If you redirect the output of the batch itself then what you'll get is the echo of the batch file commands! This is why this will not work as expected:
testping >> ping.txt
ping
command? I am wondering if something else is causing issues. I know if I make a batch with just that ping command in it, it works.