The UDF is a black box. You don't have to understand it, just give it the values it needs. To each his own, but respectfully, this is far easier to read and fix when you have issues like the one your are describing. Adding all this code adds no noticeable time to your script execution time.

 Code:
For each $folder in dirplus("Directory","/ad")
  copy source $folder\destination
Next


No manual is going to help here, although there is a FAQ on it. Even that is not going to help because it's a complex command line that needs both types of quotes to work properly.

I started with a single quote because you needed a double quote for the path and the tokens. Once I got to a section of the code that needed the single quote, I stopped the single quote, used a "+" and then used a double quote to enclose the single quotes, and repeat.
_________________________
(... better days ahead)