Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to Delete all contents of a "File with no extension" using windows batch Command

I want to delete the contents of a file which has "FIlE" as extension i.e with no extension. I know how to delete the contents of a Text file, but not about the file which has "File" as extension.

I would appreciate your efforts. Thanks in advance.

like image 939
mannu singh Avatar asked May 17 '12 12:05

mannu singh


1 Answers

Use Del *. in batch file to remove files with no extension.

use Dir /A-D *. to list down all files with no extension.

Use following command to clear the contents of a file

findstr "Any data that is not available in origfilename" origfilename > origfilename
like image 69
Romil Kumar Jain Avatar answered Sep 28 '22 05:09

Romil Kumar Jain