This is common problem due to the inherited restriction of the Windows file system. The quickest way is to use robocopy that is now part of Windows Server 2012 and supports long file names. We are basically mirroring an empty directory to the directory we would like to delete and because the source is empty it will clear the destination directory. One done you can delete the empty_dir and the the_dir_to_delete.
mkdir empty_dir robocopy empty_dir the_dir_to_delete /s /mir rmdir empty_dir rmdir the_dir_to_delete