Delete File
This article provides information on the following topics:
Note: The Actions Quick Reference provides a complete list of actions that you can print for easy reference.
What is the Delete File Action?
The Delete File Action deletes one or more files.
Creating a Delete File Action
Select Files & Folders Actions to expand the Action list. Select theDelete File Action from the Actions list to display the Action Builder.
Both the Timing and Error settings for this action may be configured to fine tune the how the Action will run.
Note: For more information about Timing and Error settings, read the Action Builder article.
Enter the File to be deleted . Be sure to enter the full file path.
Note: When entering the file path , an asterisk (wildcard character) can be used to select multiple files. The following example selects all the .txt file in the directory: "C:\MyFolder\*.txt"
Check the Include subfolders option if you would also like to delete files in subfolders.
Check the Use recycle bin option if the deleted files should be moved to the Windows Recycle Bin rather than being permanently deleted.
Note: Selecting the Use recycle bin option can slow down your script by several seconds. Only select this option when needed.
The Options section allows you to further refine which files are considered. Enabling any of the these options will only include files with specific attributes. You have the ability to filter files by:
- Create date
- Equal to
- Newer than
- Newer than or equal to
- Older than
- Older than or equal to
- Last modified date
- Equal to
- Newer than
- Newer than or equal to
- Older than
- Older than or equal to
- File size
- Equal to
- Larger than
- Larger than or equal to
- Smaller than
- Smaller than or equal to
Additionally, you have the ability to filter by the Read-Only, Archive, Hidden, System, and Compressed attributes of the file.
Optionally add Notes to the Action to document any special instructions or functionality. When the Run Switchis set to Run, the action will be executed after clicking OK.
Note: The run switch is set to Run by default. To create or modify this action without executing it, click the slider to change the option to Don't Run. For more information, see Action Builder.
Click the OK button to save the Action.