Trouble with invoke method


#1

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


#2

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: https://msdn.microsoft.com/en-us/library/system.io.directory.delete(v=vs.110).aspx


#3

Hey @Harshavardhan

Directory.Delete Method (path, recursive)

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

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

recursive
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)

Regards…!!
Aksh


How to Delete all files & all folders in a specific directory
#4

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


#5

Hi @DK_1994,

Refer below link,

Regards,
Arivu