AMDeleteFile Method

Action2 Example

 

Encapsulates the AutoMate™ action in the “File I/O” group, “Delete a file.” The method attempts to delete the specified file.

 

Declaration

function AMDeleteFile (varFilename As Variant) As Integer

 

Parameters

varFileName

 The full path to the file to be deleted.

 

Description

The AMDeleteFile method attempts to delete the file specified by varFilename.

 

Use the AMDeleteFile method with caution. The method permanently deletes the file from the system. It does not move the file to the recycle bin.

 

The AMDeleteFile method supports wildcards.

 

If the file is successfully deleted, AMDeleteFile returns “0.” If an error occurs, AMDeleteFile returns “1.” In this case, use the GetLastError property to retrieve the error message AutoMate™ generated when trying to delete the file.