Delete Folder

What does Delete Folder do?

The Delete Folder directive deletes an existing folder if it exists.

If the folder does not exist, the step will simply display an error message but will not exit the execution of the remainder of the Prog script.

Also note that the deletion of the folder occurs in a recursive manner. This means that any subdirectory and files within the target folder will also be deleted at the same time.

How do I use the Delete Folder directive?

To delete a folder, enter the absolute directory path of the folder you want to delete.

Proggy also accepts the use of wildcard. For example, if you want to delete all folders that start with the letters abc, you can use abc* as the source file.

Behaviour of the Delete Folder directive

  • If the target folder(s) does not exist, the directive will be skipped.
  • If some folder(s) could not be deleted, the Prog command will let you know which deletions were unsuccessful. However, the Prog command execution will continue to run.
  • It should be noted that this directive will not delete files if they are set as the target. To delete files, you must use the Delete File directive. However, if you delete a folder containing files, all files within that folder (and recursively) will be deleted. Use this directive with caution!

Example use cases for the Delete Folder directive

  • Performing routine file and folder manipulation