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.
batch-file Echo @Echo off @echo off prevents the prompt and contents of the batch file from being displayed, so that only the output is visible. The @ makes the output of the echo off command hidden as well.
To delete a file, use the following command: del "<filename>" . For example, to delete Test file. txt , just run del "Test File. txt" .
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.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With