0

I am trying to get the output of my batch file into a text file. I know by using '>' I can get the standard output stream text, however in this case the batch file has multiple cmd commands and I don't know how to get outputs for each of this into a text file.

Any help is greatly appreciated.

1 Answer 1

1

Hope this helps

@echo off
rem start the file with a single >
echo test1 > file.txt
rem append the file with a double >>
echo test2 >> file.txt
type file.txt
Sign up to request clarification or add additional context in comments.

2 Comments

Thank you for quick response. So by using pipe I should be able to it.
The >> is a double greater than sign, the pipe is this | but William's answer will work perfectly.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.