Share via

deeply nested folder cant be deleted. error comes back "directory not empty."

Anonymous
2022-06-01T01:46:48+00:00

Somehow a directory tree got created thats like 30 levels deep, canon\canon\canon\canon... I've navigated all the way down and there is nothing in any of them. I've tried changing ownership of the whole tree and it didnt help. Opened an admin cmd prompt and used rmdir /q /s and still nothing. I can rename the top level dir, but nothing else. I suspect that it'**** the max length for path. Any ideas on how to proceed?

Windows for home | Windows 10 | Files, folders, and storage

Locked Question. This question was migrated from the Microsoft Support Community. You can vote on whether it's helpful, but you can't add comments or replies or follow the question.

0 comments No comments

1 answer

Sort by: Most helpful
  1. Anonymous
    2022-06-01T02:40:39+00:00

    Hi Hal. I'm Greg, 10 years awarded Windows MVP, here to help you.

    Here are all ways to delete files that won't delete:

    1. Did you try taking ownership first of folder and then all of the files inside - using this handy right click shortcut which installs a Take Ownership shortcut to your right click menu to use in cases like this on files and folders which won't cooperate:

    https://www.askvg.com/add-take-ownership-option.... The only warning is to not use it on C:\Windows folder files as this will compromise security.

    1. If that doesn't work then try these strategies:

    https://www.techadvisor.com/how-to/windows/how-...

    https://windowsreport.com/cant-delete-files-fol...

    (Avoid ad links which intrude into editorial copy, especially avoid Restoro, PC Repair Tool and Reimage ads)

    https://www.sitepoint.com/force-windows-delete-...

    https://www.techbout.com/unable-to-delete-file-...

    https://computingforgeeks.com/force-delete-file...

    1. If none of these methods work, then browse in from Command Prompt in Repair Mode or bootable media to delete the file following this same method used to Rescue Files when Windows won't start, so it cannot block it:

    https://answers.microsoft.com/en-us/windows/for...

    Feel free to ask back any questions. Based on the results you post back I may have other suggestions if necessary.

    ______________________________________________

    Standard Disclaimer: There are links to non-Microsoft websites. The pages appear to be providing accurate, safe information. Watch out for ads on the sites that may advertise products frequently classified as a PUP (Potentially Unwanted Products). Thoroughly research any product advertised on the sites before you decide to download and install it.

    Was this answer helpful?

    0 comments No comments