batch-file – Creating Files using Batch – Redirection

Format:

[command] [> | >>] [filename]

> saves the output of [command] into [filename].

>> appends the output of [command] into [filename].

Examples:

  1. echo Hello World > myfile.txt saves "Hello World" into myfile.txt

  2. echo your name is %name% >> myfile.txt appends "your name is xxxx" into myfile.txt

  3. dir C:\ > directory.txt saves the directory of C:\ to directory.txt

if you want to reproduce, please indicate the source:
batch-file – Creating Files using Batch – Redirection - CodeDay