I want to run my batch script and at the same time print the echo's on screen as well as log them into a file. I could do it individually, i.e. either print the output on screen or log to a file but not both at the same time. How it can be achieved?

Any help is appreciated.


Recommended Answers

All 3 Replies

no way with a batch file, unless you want to try to parse the text log as it is being written

Hi Thanks a lot for the input. I would definetly use your idea, it looks promising. But luckily I use cygwin so I just created one more bat file and called the original as under;

file2.bat ! tee txt.log


well, you can't really expect me to guess that you'r batch files are run not under windows :)

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, learning, and sharing knowledge.