I want to delete all the files of certain type in in a folder. However, I only have the absolute path to the folder. What can I do?
For example, I might want to delete on the .txt files in C:\example.
I want to delete all the files of certain type in in a folder. However, I only have the absolute path to the folder. What can I do?
For example, I might want to delete on the .txt files in C:\example.
This should do it:
<?xml version="1.0" encoding="UTF-8"?>
<project basedir="." default="deletetxtfiles" name="Deletefiles">
<target name="deletetxtfiles">
<delete>
<fileset dir="C:/Example" includes="*.txt"/>
</delete>
</target>
</project>
It deletes only txt files from C:\Example. Folders, other file types or txt files in subfolders will not be affected.