How do you redirect standard input to a file in the Windows command line?

后端 未结 4 1091
一个人的身影
一个人的身影 2021-01-01 19:34

On Unix I would do something like:

cat > file.txt

How can I do this on the Windows command prompt or batch file?

EDIT:

4条回答
  •  耶瑟儿~
    2021-01-01 20:14

    TYPE CON

    CON is the MS-DOS device for console input. You can redirect to a file as follows:

    TYPE CON>output.txt

    To terminate, hit Ctrl + C or Ctrl + Z, Enter (Ctrl + Z = EOF).

提交回复
热议问题