0

When using Windows 10 command prompt, i know i can log the results to file by doing this :

dir c:\ > results.txt

But problem is, doing this , the results are NOT displayed on the screen.

Is there a way to use both ways at the same time ? I want the results to be displayed in real time AND log to file.

delphirules
  • 1,005

2 Answers2

1

Its possible to first write it to the textfile and then displaying it by using the following command:

dir > a.txt | type a.txt

It may have problems including the first few lines. If you need those too, you can use:

dir > a.txt & type a.txt

The only downside is that if the dir command takes a long time, its going to take a while before you see the output.

If dir is really long and you want the output to take place at the same time, powershell is a better tool in that case. Keep in mind, that if you do display the output and log it at the same time, the displaying will cause a slowdown as well.

LPChip
  • 66,193
0

Your simplest and (in my opinion) best option on a Windows machine is to use Baretail, and tail the log file.