So, you can’t delete a folder in Windows because of “Path too long” errors?

If you have got yourself into a situation where you can’t delete a directory in Windows because the folder structure is too deep for Windows, you can use robocopy to save the day. Here’s a little snippet for wiping out those “path too long” directory trees:

mkdir tmp
robocopy tmp target_too_long_for_windows_delete /s /mir
rmdir tmp
rmdir target_too_long_for_windows_delete

Hope this helps!

This entry was posted in Batch Files, Windows. Bookmark the permalink.

Leave a Reply

Your email address will not be published. Required fields are marked *