1

When I try to rename (or move) a folder, I get Folder Access Denied, and
You'll need to provide administrator permission to rename this folder.
There are three options: Continue, Skip, or Cancel. See the screenshot below.

'need to provide administrator permission' - Continue

It's not a big deal, really. – I click Continue, and the folder is renamed.
But when this happens frequently, it soon gets rather annoying.

Some prerequisites :

  • I am using an administrator account.
  • I am the owner of the folder.
  • My folder permissions are Full control.
  • I have set User Account Control to Never notify.
    (Press WinKey+r, copy-paste 1 useraccountcontrolsettings, and press Enter.)
  • The folder is outside both C:\Program Files and C:\Program Files (x86).

The behavior is as if the folder were in C:\Program Files, for example.

I had the same problem a few years ago. I found a link online that explained how to solve it.
If I recall correctly, it was a simple matter of changing merely one of the folder properties.
Frustratingly, it seems I never bookmarked that helpful link.

I have to click Continue every time, to rename the folder. How can I avoid this?

Some related questions


1 Ctrl+c to copy, and Ctrl+v to paste.

0

2 Answers 2

0
I have to click Continue every time, to rename the folder. How can I avoid this?

Right-click the folder, then Properties > Security > Advanced > Enable inheritance > OK.

Solution: click 'Enable inheritance', and then OK.

^ click to enlarge

This solved it for me. But maybe your case is different? 1


1 Does this help? Fix the “Failed to Enumerate Objects in the Container” Error.

1
  • You might want to change the owner of the folder. It appears the user who owns the folder might have come from another Windows machine. I say this because the machine name is in the owner, but the full string is cut off, suggesting it’s a user from not the same machine. As you found out you can rename the file, but it requires you to confirm that elevated task, which is successful since Administrators user group is in the ACL
    – Ramhound
    Commented Jan 6, 2023 at 13:58
0

To take control of the folder that cannot be deleted, create a text file called delete.bat and add the following lines to it:

 SET DIRECTORY_NAME="C:\Locked Directory"
 TAKEOWN /f %DIRECTORY_NAME% /r /d y
 ICACLS %DIRECTORY_NAME% /grant administrators:F /t
 ICACLS %DIRECTORY_NAME% /reset /T
 PAUSE

You will need to change the directory path to match your requirements e.g. C:\Locked directory to C:\directory_name_you_want_to_delete.

Right click on the file delete.bat, select Run As Administrator and you should now have full control of the directory and all sub directories meaning you can do what you wish with them.

1
  • Your suggestion would make me the owner of the directory, but as I've stated in the second bullet of the prerequisites, I already am the owner of the directory. Commented Jun 21, 2023 at 14:25

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .