How to delete content from a text file using windows batch script

前端 未结 5 1982
星月不相逢
星月不相逢 2020-12-28 13:03

I have a demo.txt file. I need to delete content in that file using a batch file. Please tell me the command to delete content for demo.txt file.

5条回答
  •  灰色年华
    2020-12-28 13:20

    break>demo.txt
    

    Try this.it will set an empty file on the place of demo.txt. As break is internal command that does nothing it should be pretty fast.Also the break command can produce output only with /? argument so this makes this method pretty robust.

提交回复
热议问题