How to echo “2” (no quotes) to a file, from a batch script?

后端 未结 11 1360
孤街浪徒
孤街浪徒 2020-12-02 22:13

How do I echo the number 2 into a file, from a batch script?

This doesn\'t work:

Echo 2>> file.txt

because 2&g

11条回答
  •  执笔经年
    2020-12-02 22:20

    escape the haracter '2'

    in linux: echo \2>file.txt

    in windows: echo ^2>file.txt

    in windows this also will work

    echo.2>file.txt no space between echo and the dot

提交回复
热议问题