General discussion

Batch file log

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?


Discussion is locked

Reply to: Batch file log
PLEASE NOTE: Do not post advertisements, offensive materials, profanity, or personal attacks. Please remember to be considerate of other members. If you are new to the CNET Forums, please read our CNET Forums FAQ. All submitted content is subject to our Terms of Use.
Reporting: Batch file log
This post has been flagged and will be reviewed by our staff. Thank you for helping us maintain CNET's great community.
Sorry, there was a problem flagging this post. Please try again now or at a later time.
If you believe this post is offensive or violates the CNET Forums' Usage policies, you can report it below (this will not automatically remove the post). Once reported, our moderators will be notified and the post will be reviewed.
- Collapse -
Just checking.


- Collapse -
Re: Just checking

Yep, got ECHO ON in there.

- Collapse -
Given this much to work with.

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

- Collapse -
Re: Given this much to work with

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.

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.

- Collapse -
You need the TEE command...

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,

CNET Forums

Forum Info