I encountered a quirky problem the other day when I was trying to clean up one of my hard drives before copying its contents to another drive: I couldn’t delete a folder.
Illustration: Pixabay
Technically, I was trying to get rid of a folder within a folder within a folder by deleting the top-level folder – a mouthful, I know – but Windows wouldn’t delete it. According to the OS, it couldn’t find the very last folder in the tree; since that was missing, it couldn’t delete anything.
I’d normally try to get out of this issue by rebooting into safe mode and seeing if that fixed whatever issue Windows was having. I was feeling lazy, however; lazy, and curious to see if there was any other method I could use to ditch the unwelcome nested folders without having to close out of all my work and waste minutes going through two full system restarts.
I can’t recall where I found my fix from, or else I’d happily credit the originator for this great solution, but here’s how I was able to finally delete that random folder that Windows claims it couldn’t find. One caveat: This may or may not work if you’re having a similar situation. I have no idea why Windows was being so fussy in the first place, and I haven’t experienced this issue since, or else I’d try to replicate the solution to see if this trick always works.
How to fix Windows when it’s fussy about deleting files
Go grab 7-Zip. It’s a great open-source program to have on hand for unpacking all kinds of archives, such as the ZIP and RAR files you’re probably used to dealing with. You might be able to use this trick with similar tools such as WinRAR, but I have 7-Zip, and that’s what worked for me.
Since Windows was having trouble understanding that the final folder among a few nested folders even existed – Inception‘s limbo, not its hotel scene – I had to first navigate to the folder that contained this mystery folder. In other words, the parent folder of the folder that Windows allegedly could not find, but was mocking me with its immortality right there in File Explorer.
Screenshot: David Murphy
I then right-clicked on the “missing” folder, selected the 7-Zip option in the context menu, and clicked on “Add to archive”. An unconventional step? Yes. Hear me out.
After that, I checked the option to “Delete files after compression” within 7-Zip’s “Add to archive” window. And that’s it. I clicked “OK” to start the app, which created a .7z archive file of my empty “missing” folder and deleted it out of File Explorer. Poof!
With that weird folder finally zapped out of existence, I went back to the top-level folder and performed a simple shift-delete, wiping the entire folder tree out of existence.
I’m still not quite sure how or why this trick managed to fix my issue – identifying and deleting something Windows could not. Just to make sure I wasn’t crazy, I pulled up an earlier backup of the nested folders and tried to delete everything by having 7-Zip archive and delete the top-level folder. No luck. Unless I killed the buried mystery folder, its parents would not go away. Chalk this one up to “Windows quirks that drive you nuts”.
Comments
6 responses to “How To Delete A Stubborn Folder In Windows”
Sometimes it’s things like folder names beginning with a space, or that is named after a reserved word. Using network syntax will help in a number of cases: del \\?\c:\path_to_file
It may be down to the 260 character limit to file paths that has existed in Windows for a long time. To get around it, map a drive to a parent folder that is working, navigate to the mapped drive and then perform the delete function from there.
You can map a drive via the command prompt in the following format:
net use Z: “\\localhost\C$\folderpath”
When Windows does weird stuff like this I just boot into Linux and delete the offending files.
You could boot Linux from a USB flash drive or install a Linux distro on the hard drive and dual boot.
I’ve had this issue, you can use the command line function called robocopy to rename the folder. I forget the exact syntax needed but a quick Google should bring it up and no additional programmes required.
Out of curiosity when you navigated to the penultimate folder did you try to manually delete the offending folder?
I use “Unlocker” – http://www.majorgeeks.com/files/details/unlocker.html
Had a similar issue within Add/Remove Programs. I deleted a program entirely via by its folder on my drive, then emptied my trash bin, then tried removing it through add/remove programs and it couldn’t and wouldn’t delete it cause it didnt exist. Drives me mad seeing the program in the list but its not actually there.