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

前端 未结 5 1970
星月不相逢
星月不相逢 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:28

    type nul > demo.txt
    

    works and also works in JPSoft's TakeCommand TCC.EXE command shell (where "break" will output "BREAK is ON" rather than nothing as it does in Microsoft CMD.EXE)

    The general idea is to find a command that outputs Nothing and redirect that to the file using >

提交回复
热议问题