Trouble with invoke method

issue … hey i got a problem with this can any tell how to get over with it

Could you send this workflow or post what type of arguments do you pass into Delete method? This error means that parameters you passed does’t match any Delete method overload. Delete method accepts one or two arguments: Directory.Delete Method (System.IO) | Microsoft Learn

Hey @Harshavardhan

Directory.Delete Method (path, recursive)

Deletes the specified directory and, if indicated, any subdirectories and files in the directory

Type: System.String
The name of the directory to remove.

Type: System.Boolean
true to remove directories, subdirectories, and files in path; otherwise, false.

Note- If you will not pass Recursive parameter and if directory(which you are deleting , is not an empty then it will throw Error that directory is not empty. only when you are not Deleting files within a for each iteration.

Here i am attaching three things in a workflow

  1. Delete a directory by using For each , one by one.
  2. Delete a directory all files only by using for -each. one by one.
  3. Delete a directory and its sub-directory in a single shot

*All above I have used Invoke method :slight_smile:

directory Delete.xaml (9.4 KB)



could you please explain me some basic example of invoke method…I am new to UI path.

Hi @DK_1994,

Refer below link,