RemoveDirectory

KCM Core removes the specified directory. When the Recursive parameter is True, the folder and all of its contents are removed; otherwise, only empty directories are removed.

  • The RemoveDirectory command succeeds if the specified directory could be removed or if the directory did not exist.
  • The RemoveDirectory command fails if the specified directory is not empty, and the parameter Recursive is not True.
  • The RemoveDirectory command fails when the specified folder cannot be deleted, or a file or a directory within the specified folder cannot be deleted when the parameter Recursive is True.

Syntax

RemoveDirectory
   Dir(<text>)
   Recursive(<True or False>);

Parameters

  • Dir: Required. The directory that KCM Core removes.
  • Recursive: Optional (the default value is False). If set to True, KCM Core removes all directories and files in the specified directory, in addition to the directory itself. This parameter is used to recursively remove a directory tree.