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.

Hi, Welcome to UiPath Community Forum. The InvokeMethod activity is another way to implement a code which is outside of the standard built-in activities. You can use this activity to invoke a method of a class. The class does not need to be part of the workflow or use any of the workflow base classes. The InvokeMethod calls a public method of a specified object or type. InvokeMethod Properties: MethodName: Assign the method name to this property. TargetObject: When we want to…