Is it possible to redirect the output of a batch file inside the script?

前端 未结 2 1864
一整个雨季
一整个雨季 2020-12-19 04:43

I would like to set the standard output of a batch script to go to a file. I would like to do this inside the script if possible.

Note: I do no

2条回答
  •  借酒劲吻你
    2020-12-19 05:28

    > is the standard, so you're more-or-less stuck with that; however, you can move it inside the batch file:

    foo.bat:

    @echo off
    @echo Start File > StdOut.txt
    @dir >> StdOut.txt
    @echo End File >> StdOut.txt
    

提交回复
热议问题