The version from Quick buttons for directory organisation works. (The root post in that thread was updated recently, so you may have an older version of the command.)
The quotes on the last line are the main thing, but I would also add the NORECYCLE SKIPNOTEMPTY
so it doesn't delete folders that still contain files (which can happen if a nested folder has the same name as the parent).
@set ChildPath={sourcepath$|noterm}
Copy MOVE * TO ..
Go ..
Delete FILE="{$ChildPath}" NORECYCLE SKIPNOTEMPTY QUIET