Sunday, November 19, 2017

windows 7 - Delete folder, subfolder and files in long path


I have tried solving this problem by googling and browsing superuser.com, but haven't found a viable solution yet. I'm running Windows 7 btw.


I somehow got Arduino to recursively create folders named "libraries" within the parent-folder called libraries. Somewhere down the path, there are also some library-files and now I can't delete the damn thing.
The path is so deep, that I can't enter it all the way down to the files.
Every time I try to delete the files I get an error saying either something like "path too long" or "Directory not empty".


I have tried deleting it through the cmd.exe using:


del /S /Q libraries\*
rmdir /S /Q libraries

I also tried robocopy, as some threads mentioned this as a solution.


robocopy ROBCOP libraries /s /mir

And finally I have tried using a tool called DelinvFile. This tool started to delete the folder, but after deleting ~6000 subfolders, it stopped with the error "Directory not empty".


Answer



I tryed different types of software, including some recursive deletion tools. In all cases the software crashed.


I managed to delete the folder, by installing a version of Ubuntu on a USB-stick, booting it up in Ubuntu and deleting it through the terminal using the recursive (-r) parameter. It took between 5-10min for the computer to delete the folder (amazing, as it only contained folders and 300kb of data).


After reboot, Windows felt the need to repair windows. I got a notification saying Windows wasn't able to repair, but when I booted up again everyting was working perfectly.


No comments:

Post a Comment

hard drive - Leaving bad sectors in unformatted partition?

Laptop was acting really weird, and copy and seek times were really slow, so I decided to scan the hard drive surface. I have a couple hundr...