Skip to main content

Delete File

AutomatR.DefaultActivities.FileAndFolder.DeleteFile

The "Delete File" activity in AutomatR allows you to remove a specified file from a designated location. This activity simplifies the process of deleting files within automation workflows, providing efficient file management capabilities.

Properties

NameDescription
Input
File PathEnter the full path of the file on your local drive, including the filename, which needs to be deleted. Example: "C:\deleteit\unused.txt". String variables containing the file path.
Misc
Display NameProvides a customizable name for the activity displayed in the workflow. The display name enhances clarity and organization within the automation project. String variables containing the desired display name.
Optional
DelaySpecifies the amount of time (in seconds) to wait before executing the "Delete File" activity. This can be useful for handling synchronization issues. Integer variables or arguments containing the delay duration. Example: If the amount of time is 1000 milliseconds or 1 sec, i.e., 1.

How to use:

  1. Drag and drop the "Delete File" activity onto the workflow.
  2. Configure the properties by specifying the full path of the file to be deleted.
  3. Optionally, configure the delay and customize the display name.
  4. Execute the workflow to delete the specified file.

Example: Consider an example where the "Delete File" activity is used to remove a file named "unused.txt" from the "C:\deleteit\" directory:

Delete File:
Display Name: "Delete Unused File"
File Path: "C:\deleteit\unused.txt"

In this example, the activity deletes the "unused.txt" file from the specified directory. If the file does not exist, an exception is raised. Adjust the file path as needed for your workflow.