Delete Files
ActionStep Reference » Windows » Directory » Delete Files
The ActionStep Directory Delete Files removes all the contents in a specified directory.
- Open the Windows node in the Workspace Explorer.
- Open the Directory node, select the Delete Files ActionStep.
Parameters:
The ActionStep has the following input parameters:
name |
Description
|
---|---|
Directory Path
|
The path of the directory where files are to be deleted. The entered path is not case-sensitive.
Allowed Context Scopes [Fixed, Local, Global] Allowed Context Types [Variable, Parameter, Enum] |
File Mask
|
A filter mask used in selecting the files to be deleted.
Wildcard specifiers: asterisk (*) and question mark (?) Allowed Context Scopes [Fixed, Local, Global]Allowed Context Types [Variable, Parameter, Enum] |
Delete Recursive
|
Determines whether subdirectories are included in the deletion.
Allowed Context Scopes [Fixed, Local, Global] Allowed Value [Boolean] |
Delete Hidden
|
Determines whether hidden files are included in the deletion.
Allowed Context Scopes [Fixed, Local, Global] Allowed Value [Boolean] |
Delete Read-Only
|
Determines whether read-only files are included in the deletion.
Allowed Context Scopes [Fixed, Local, Global] Allowed Value [Boolean] |
Remove Empty Folders |
Determines whether empty folders are included in the deletion.
Allowed Context Scopes [Fixed, Local, Global] Allowed Value [Boolean] |
Break on Error
|
Determines whether the ActionStep should not proceed when an error occurs.
Allowed Context Scopes [Fixed, Local, Global] Allowed Value [Boolean] |
Results:
The ActionStep returns the following results:
name
|
description
|
---|---|
File Count
|
The number of files deleted from the directory.
Allowed Context Scopes [Fixed, Local, Global] Allowed Context Types [Variable, Parameter] |
Files
|
The list of files that were deleted from a specified directory.
Allowed Context Scopes [Fixed, Local, Global] Allowed Context Types [Variable, Parameter] |
Example 1 (Removes all hidden files and read-only files):
This example checks the directory for hidden and read-only files in the documents directory and deletes them all. The Result after deletion is then output via Message Box.
Example 2 (Removes all files and folders):
This example erases subdirectories, hidden files, read-only files, and empty folders in the backup directory. The Result after deletion is then output via Message Box.