This is the same question as you asked in an earlier thread - to which
you got two answers.
Without any feedback on how that worked out for you (did you actually
try them? did they work?), you are now trying almost the same solution
again, which is failing in a similar way.
Instead of shoehorning what you think should work and ignoring the
provided answers, can you please read them and try them out?
In any case, removing and recreating directories in a single task
sounds like a bad thing to do to begin with.
To give some hint, in order of elegance, the options are:
1. find and register all files/dirs, and then delete those
2. use a shell task to "rm -rf" the contents
Dick