I
I
Ivan Melnikov2019-06-04 08:21:24
cmd/bat
Ivan Melnikov, 2019-06-04 08:21:24

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

dir /? > temp.txt
prints help on the dir command to a file without problems, but
netstat /? > temp.txt
not. The output is made to the console, and the temp.txt file is created, but empty.

Answer the question

In order to leave comments, you need to log in

1 answer(s)
A
Alexander, 2019-06-04
@immelnikoff

most likely the output goes to stderr. The construct 2>&1will redirect stderr to stdout
netstat /? 1>temp.txt 2>&1

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question