Thursday, 28 October 2010

Delete Infinite Long Folder Structure

I had a problem deleting a folder structure with what looked to be an infinitely deep folder structure. I assume some application went crazy and created this, or windows went screwy.

Using the windows GUI right click and Delete failed. (folder not empty error)
RD Path /s - This took ages to run. Completed but the folder was still there.

I got round the problem by using the Robocopy utility. I created a empty dummy directory and then performed a robopy with the /purge option.

eg. robocopy.exe "f:\dummy" "f:\folder-to-delete" /purge

This then removes the infinite folder loop and allows you to delete the folder normally.

No comments:

Post a Comment