-3

I want to know how to write a Window command line with redirection operators into a text file?

My command line to write into file text file is:

echo (name / file1.txt >> file2.txt) >> filetot.txt

The part in parentheses is the part I want to write into file filetot.txt.

But unfortunately it doesn't record anything after the first >>.

Mofi
  • 46,139
  • 17
  • 80
  • 143
James
  • 1
  • 3
    there are some chars that have a special meaning. To echo them literally, you have to escape them with a caret: `echo name / file1.txt ^>^> file2.txt >> filetot.txt` – Stephan May 13 '19 at 19:46

1 Answers1

-1

How does this do for you?

REM rest of your code
(name / file1.txt >> file2.txt) >> filetot.txt
echo (name / file1.txt >> file2.txt) >> filetot.txt

We are still issuing your command, but also echoing which command we are issuing to the filetot.txt file you specified.

artemis
  • 6,857
  • 11
  • 46
  • 99