0

I have a folder that I want to remove. Somehow, all permissions from that folder have been removed.

The parent folder has appropriate permissions for my admin account. I've tried to apply these permissions to the contained folders, but I get "Access Denied" messages. I've tried to simply update the permissions of the to-be-deleted folder, but I'm told I need read permissions to be able to do that. I've tried to cut and paste the TBD folder as well to try to delete it, but still no luck.

CACLS gave me Access Denied as well.

What else can I try?

I'm running Win10 v1803 build 17134.228

  • You should be able to utilize the method described in this answer to do it. Just modify the target to be the folder that you want to delete. – Run5k Aug 25 '18 at 17:01
  • Possible duplicate of Take ownership of entire drive? – Ramhound Aug 25 '18 at 17:31
  • @Ramhound CACLS did not work, will update my question. Haven't tried Run5k's suggestion yet – jackwise Aug 25 '18 at 23:03
  • If you can move the directory to a different drive with no contents you care about using a quick format command on that drive will ignore the combative permissions Microsoft implements in Windows. This presumes you that you can at least move the directory. So find an empty drive or create a large enough temporary partition, move the directory to it and nuke it with a quick format. – John Aug 26 '18 at 4:17
  • You can do this easily with a live bootable CD (Ex: Ubuntu, Hiran, etc). – D T Aug 27 '18 at 6:43
1

Assuming the reason you cannot delete the folder is due to there being no permissions*, do the following from an elevated Command Prompt started by a user with Administrative permissions:

takeown /f "C:\folder\folder-to-delete" /a
icacls "C:\folder\folder-to-delete" /inheritance:e

This will exercise the Administrative user's Take ownership of files user right to grant the Administrators group ownership of the object. The second command adds all of the permissions to the folder it should inherit from its parent object.


*Versus problems like being open in another process, or malicious code on the system.

-1

We can try the command to force deletion of files and folders:

  1. Open Command Prompt, run as administrator:

  2. Type: rd /s /q D:\app (If we need to delete the folders, app is the folder name).

  3. Type: del /f /s D:\app.txt (If we need to delete the file, the file name must have a suffix of the file name).

Reference:

https://docs.microsoft.com/en-us/windows-server/administration/windows-commands/rd

https://docs.microsoft.com/en-us/windows-server/administration/windows-commands/del

Your Answer

By clicking "Post Your Answer", you acknowledge that you have read our updated terms of service, privacy policy and cookie policy, and that your continued use of the website is subject to these policies.

Not the answer you're looking for? Browse other questions tagged or ask your own question.