Search code examples
autoitdelete-file

Deleting unknown file name with *.exe extension in AutoIT


I want to delete all files which extension is .exe. For example, there are two files in some directory:

  • Something1.exe
  • Anything2.exe

How can I detect and then delete them?

Is that possible in AutoIT?


Solution

  • Yes, it's possible.

    Delete one or more files.

    FileDelete ( "path" )
    

    Parameters
    Path - The path of the file(s) to delete. Wildcards are supported.

    Return Value
    Success: - Return 1.
    Failure: - Returns 0 if files are not deleted or do not exist.