Delete File Function: deletefile
The Delete File function is used to delete a specific file with a given extension. It ensures that unnecessary or outdated files are removed from the system as part of an automation workflow.
Example: You want to delete a log file (error.log) from the system and store the result in a variable for further validation.
Steps to Configure:
- Select SET from the Action dropdown.
- In the Element Key field, enter a variable name to store the output (e.g., DeleteStatus).
- In the Parameter section, click Form and select Functions from the dropdown.
- Choose Delete File from the list of functions.
- In the Cmd filed, select delete.
- Enter the file path of the file you want to delete in the File field (e.g., C:/Logs/error.log).
- Click Save.
Note: While the steps for adding a command are identical in both views, the display of the steps changes:


Expected Outcome
- If the file is deleted successfully, the variable defined in the Element Key (e.g., DeleteStatus) will store true.
- If the file deletion fails (e.g., file not found, permission issues), the variable will store false.
- This variable can be used in subsequent steps for verification or error handling using the syntax ${VariableName} (e.g., ${DeleteStatus}).