How to save ipconfig output to text file when `tee` isn't available on Windows?

I want to save ipconfig /all to text file.I am on Windows 10.When I try this in cmd

ipconfig /all | tee file.txt

I got

'tee' is not recognized as an internal or external command,operable program or batch file.

What is Windows alternative for tee?

6

3 Answers

Try redirection. Instead of | tee, use > output.txt e.g.

ipconfig /all > output.txt
4

ipconfig /all >>logfile.txt 2>>&1

The >>logfile.txt 2>>&1 will redirect both output stream and error stream to a file called logfile.txt that will be created and stored in the current directory. If there is an existing logfile.txt in that directory it will append the output to the end of it.

3

If you install MSYS2 you can use

$ ipconfig -all | tee file.txt

Note that /all has to be written as -all.

In my case I get:

$ head file.txt
Windows-IP-Konfiguration Hostname . . . . . . . . . . . . : Death-Star [..]
7

Your Answer

Sign up or log in

Sign up using Google Sign up using Facebook Sign up using Email and Password

Post as a guest

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

You Might Also Like