0

By default the output of commandline applications is presented in console window and I know that using > or >> we can re-wrire/append the stdout to an external file but what if the commandline application doesn't have internal logging facility to save the output. I want the stdout to be both in the console and be saved in an external file. Is such a thing possible?

wiki
  • 1,877
  • 2
  • 31
  • 47
  • Possible duplicate of [Displaying Windows command prompt output and redirecting it to a file](http://stackoverflow.com/q/796476/5047996) – aschipfl Dec 13 '15 at 20:39
  • See also this post on SuperUser: [Windows: Command line redirection to text file while also seeing output](http://superuser.com/q/278115/489381) – aschipfl Dec 13 '15 at 20:41

1 Answers1

0

Try something like this:

@echo off
echo hello > log.txt & type log.txt
pause

But using this you can only have one command-output in the log-file at once. You could try it with >> but that way you get the outputs of all commands every time you use this.

Dennis van Gils
  • 3,487
  • 2
  • 14
  • 35