Save Ping Output to Text File

14,510

This is just the normal behaviour.

In batch files you have some input/output streams:

  • 0 = standard input stream
  • 1 = standard output stream
  • 2 = standard error stream
  • 3-9 = user defined streams

Your >> operator implicitly redirects the standard output stream, that is, it is redirecting the stream number 1, and the cmd parser converts the command

command >> output

into

command 1>> output

showing the explicit command executed based in an implicit request

Share:
14,510
Nishant Kumar
Author by

Nishant Kumar

Trying to be master in what i learn

Updated on June 17, 2022

Comments

  • Nishant Kumar
    Nishant Kumar almost 2 years

    I am using this batch command to save ping output to a text file,

    ping 10.226.2.10 -n 10 >>ping_ip.txt

    But when i saved the above command in a batch file and trying to run it, in command prompt window my command gets converted to the below command...

    ping 10.226.2.10 -n 10  1>>ping_ip.txt
    

    you can see there is extra 1 in 1>> in the second command, i don't know how it came.. somebody please give your valuable opinion on the same