FileRemoveDir

Deletes a folder.

FileRemoveDir, DirName , Recurse

Parameters

DirName

Name of the directory to delete, which is assumed to be in %A_WorkingDir% if an absolute path isn't specified.

Recurse

If blank or omitted, it defaults to 0. Otherwise, specify one of the following numbers to indicate whether to recurse into subdirectories:

0: Do not remove files and sub-directories contained in DirName. In this case, if DirName is not empty, no action will be taken and ErrorLevel will be set to 1.

1: Remove all files and subdirectories (like the Windows command "rmdir /S").

This parameter can be an expression, even one that evaluates to 1, 0 or an empty string.

Error Handling

[v1.1.04+]: This command is able to throw an exception on failure. For more information, see Runtime Errors.

ErrorLevel is set to 1 if there was a problem or 0 otherwise.

FileCreateDir, FileDelete

Examples

Removes the directory, but only if it is empty.

FileRemoveDir, C:\Download Temp

Removes the directory including its files and subdirectories.

FileRemoveDir, C:\Download Temp, 1