1

i need to capture the output of a batch file (maintenance.bat) that will run on a schedule to restart services and run some maintenance. i need to see the output of the bat file.

my bat file calls other bat files. here is an example

pushd d:\workingdirectory
call servicecontroller.bat services.stop
call rotatelogs.bat
call pushconfigupdates.bat
popd

i need to capture the output of all the commands ran.

Thanks

1 Answer 1

3

try with

myfile.bat > log.txt

For more info you can check here.

Sign up to request clarification or add additional context in comments.

1 Comment

with myfile.bat > log.txt 2>&1 you'll be able also to capture the error stream

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.