Thank you for being a valued part of the CNET community. As of December 1, 2020, the forums are in read-only format. In early 2021, CNET Forums will no longer be available. We are grateful for the participation and advice you have provided to one another over the years.

Thanks,

CNET Support

General discussion

Batch file log

Nov 7, 2010 1:11AM PDT

I was looking to run a batch file and create a log file as it runs. I know how to run a log by using a '>' parameter, but it doesn't allow me to watch the batch file's progress as well. The cmd window is blank. I am looking to have the individual steps visable while creating the log file as well.

Is there a way to do this?

Thanks...JohnB

Discussion is locked

- Collapse -
Just checking.
Nov 7, 2010 11:27AM PST

Is ECHO ON?

- Collapse -
Re: Just checking
Nov 7, 2010 12:27PM PST

Yep, got ECHO ON in there.

- Collapse -
Given this much to work with.
Nov 7, 2010 1:16PM PST

I'll say you'll have to echo out what you want to see from the batch file.
Bob

- Collapse -
Re: Given this much to work with
Nov 7, 2010 1:25PM PST

I don't understand what you're saying. I want to see every command as it is executed. When I add the '> report.txt' parameter, the log file that I want is created, but the commands are no longer seen as they run (even with ECHO ON).

- Collapse -
I can't know what you don't tell.
Nov 7, 2010 3:26PM PST

It sounds as if someone changed something. But given only what you tell all I can offer is that we re-write the script to echo what you want to screen or file.
Bob

- Collapse -
You need the TEE command...
Nov 7, 2010 9:55PM PST

Unfortunately, that is not a standard capability offered by the Windows command line. However, if Windows PowerShell is an option in your use case, you'll find it is natively supported. Otherwise, you'll need to look at third-party solutions, such as Wintee.

Hope this helps,
John