The AutoIt FileDelete Function is used to delete files. If a directory path is supplied, all files within the given directory will be deleted, leaving behind a empty folder – this behavior is different than that of FileRecycle, wheres the folder will be moved as well as its contents.
FileDelete will attempt to delete the file directly – if you want to move the file to the Recycle Bin, use FileRecycle instead.
Returns 1 on success, and 0 on failure (can indicate that the file is in use).
AutoIt FileDelete Example
The below example will delete all .txt files from a directory.
You can also use absolute paths, how to do that is shown below.