batch-file Input and output redirection

Help us to keep this website almost Ad Free! It takes only 10 seconds of your time:
> Step 1: Go view our video on YouTube: EF Core Bulk Extensions
> Step 2: And Like the video. BONUS: You can also share it!

Syntax

  • [command] [[> | >> | < | 2> | 2>>] file]
  • [[> | >> | < | 2> | 2>>] file] [command]

Parameters

ParameterDetails
commandAny valid command.
>Write STDOUT to file.
>>Append STDOUT to file.
<Read file to STDIN.
2>Write STDERR to file.
2>>Append STDERR to file.
fileThe path to a file.

Remarks

  • You can add as many different redirections as you want, so long as the redirection symbol and file remain together and in the correct order.


Got any batch-file Question?