I spent a lot of time to find a solution for the issue I had several weeks ago.
In a certain folder al like to delete one folder and all the content in that folder. Many solutions I tried raise up with an error (or more). So I tried the following simple DOS-command. This works fine for me ==> rmdir /s /q c:\test\subfolderX (in this sample the subfolderX and all the content have to be deleted).