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
.
.
.
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
You’re doing something strange with pipes.
This (from command line) will append the
pingresult toping.txtfile.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.
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: