Delete File

The Delete File action found under the @Generic Element is used to delete the file located at the path specified in the input and store the result in an dynamic variable.

Syntax

Input Value: <file_path>;<file_name.extn>

Argument
Description

<file_path>

(Required)

Specify the folder location which needs to be deleted.

<file_name.extn> (Required)

Name of the file (with extension) that needs to delete. Note: Supported file formats are .txt. .xlsx, .xls, .pdf, .gif, .doc, .xml

Output Value:

Argument
Description

<Dynamic Variable>(Optional);<Dynamic Variable>(Optional)

This variable stores the status as true or false

Example

Delete a specified file from a given location The Delete File action removes the specified file from the given file path (e.g., C:\sam;Report.txt). The status of the deletion operation is stored in the {Status} variable with the following possible values:

  • True if the file is deleted successfully

  • False – if the file does not exist or the deletion operation fails (e.g., If the path is incorrect).

Last updated

Was this helpful?