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

See Also

  • Check If Directory Exists
  • Convert Base64 to File
  • Convert File to Base64
  • Copy File
  • Count Files
  • Create Directory
  • Delete File
  • Delete from Directory
  • Download from File System
  • Get Directories
  • Get Files
  • If File Exists
  • Move File
  • Read All Bytes
  • Read All Text
  • Rename File
  • Send to File System
  • Write to File