Delete Directory
Verb: deleteDir
Deletes a directory, finding what should be deleted by its path and the file system.
Syntax
deleteDir --directoryname(String) [--fileSystem(FileSystem)] (Boolean)=value
Inputs
Script | Designer | Required | AcceptedTypes | Description |
---|---|---|---|---|
--directoryname | Directory | Required | Text | Directory that should be deleted. |
--fileSystem | File System | Optional | File System | Connection variable to a file system.
1. To obtain the connection variable with an available file system, this connection must be established using one of the following commands: IBM RPA Control Center. 2. If nothing is specified in this parameter, the local file system of the operating system is used as default. |
Outputs
Script | Designer | AcceptedTypes | Description |
---|---|---|---|
value | Success | Boolean | Returns "True", if the directory was successfully deleted, or "False" if otherwise. |
Example
The Create Directory command creates a directory on the desktop called "folderToDelete", and the Delete Directory command deletes it.
defVar --name success --type Boolean
defVar --name desktop --type String
getSpecialFolder --folder "Desktop" desktop=value
createDir --path "${desktop}\\folderToDelete"
deleteDir --directoryname "${desktop}\\folderToDelete" --comment "Delete Directory" success=value
logMessage --message "${success}" --type "Info"
// Success: True