If you’ve ever had a folder that won’t delete because Windows says “the path is too long”, you’ve probably felt the frustration of trying many different methods in vain.
Luckily, if you’re running a modern version of Windows (which everyone should be), you’ll have robocopy, which can help you out in this case.
To delete that pesky folder, follow these steps: –
- Create a new blank folder called whatever you like (for example, “DeleteMe”)
- Open up a command prompt (depending on the folder you’re trying to delete, you may need to run as an administrator)
- Run robocopy using the example below, assuming that the folder you are trying to delete is called “C:\PeskyFolder” and the blank folder you created is called “C:\DeleteMe”
robocopy “C:\DeleteMe” “C:\PeskyFolder” /e /mir
The above command will “copy” everything out of “C:\DeleteMe” and “paste” it into “C:\PeskyFolder” overwriting any existing contents… Which in this case, deletes the entire contents of the folder.
When it’s done, simply delete the folder itself.