Trying to delete a folder on windows …

Trying to delete a folder on windows sometimes is thwarted by the error “ Cannot delete” “volume label syntax is incorrect

I tried every non-destructive method listed out there

rd <path> /s  aka; rmdir <path>   /s

changing long file or directory names

When I want to delete something I don’t have time to mess around, so came up with this quick little workaround…
using cygwin…
opened a cygwin shell and cd to the parent directory of the stubborn folder
ran find -type f -exec mv {} /tmp/delme ; && rm -f /tmp/delme
Now, the directory structure is empty, proceed with your rmdir

Leave a Reply

You must be logged in to post a comment.