redirect to a file and to the screen?

Y

yawnmoth

"dir > dir.txt" will output the dir results into dir.txt, while "dir"
will output it to the screen. Is there a way of making it so it can be
output in both places? eg. log it to a file and output it to the
screen?

For dir, you could just do it twice, but for more time consuming
applications, doing it twice is not such a great option.
 
P

Pennywise

|>"dir > dir.txt" will output the dir results into dir.txt, while "dir"
|>will output it to the screen. Is there a way of making it so it can be
|>output in both places? eg. log it to a file and output it to the
|>screen?
|>
|>For dir, you could just do it twice, but for more time consuming
|>applications, doing it twice is not such a great option.

Thoughts.
CON: is the console device name (screen).
Separating commands with & allows you to string commands together.
 
P

Pennywise

(e-mail address removed) wrote:

|>
|>|>"dir > dir.txt" will output the dir results into dir.txt, while "dir"
|>|>will output it to the screen. Is there a way of making it so it can be
|>|>output in both places? eg. log it to a file and output it to the
|>|>screen?
|>|>
|>|>For dir, you could just do it twice, but for more time consuming
|>|>applications, doing it twice is not such a great option.

|>Thoughts.
|>CON: is the console device name (screen).
|>Separating commands with & allows you to string commands together.

Practice:

Start | Run <type in> cmd /k dir > junk & notepad junk <enter>
 
P

Pegasus \(MVP\)

yawnmoth said:
"dir > dir.txt" will output the dir results into dir.txt, while "dir"
will output it to the screen. Is there a way of making it so it can be
output in both places? eg. log it to a file and output it to the
screen?

For dir, you could just do it twice, but for more time consuming
applications, doing it twice is not such a great option.

These might help:
Stream splitter from http://64.38.67.11:8080/freeware/tee.zip
or http://www.commandline.co.uk/mtee/
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top