Why help on the netstat utility is not redirected to a file?

dir /? > temp.txt
displays help for the dir command to a file without problems, and
netstat /? > temp.txt
– no. The output is in the console and the file temp.txt is created but is empty.
March 23rd 20 at 18:59
1 answer
March 23rd 20 at 19:01
Solution
most likely the output goes to stderr. Design 2>&1 will redirect stderr to stdout
netstat /? 1>temp.txt 2>&1
netstat /? > C:\netstat.txt 2>&1
works. Thank you.
But why the output is to stderr and not to stdout? - meggie_Rosenba commented on March 23rd 20 at 19:04
@meggie_Rosenba, this question should be to ask the author of the netstat program every programmer has their own cockroaches in my head. But, sure enough, there was some good reason. - montana66 commented on March 23rd 20 at 19:07
@meggie_Rosenba,
But why the output is to stderr and not to stdout?

Many utilities do not only in Windows, get used to it. - gunnar commented on March 23rd 20 at 19:10

Find more questions by tags Windowscmd/bat