Why is my computer telling me I need permission to delete something?

I can't delete a certain folder in Windows 7. It's not a system folder. It was created by an app. I get an error message "You need permission to perform this action. You require permission from Tony....". I am an admin and logged in as myself Tony. I have full ownership of the folder with full control permission. I rebooted the machine. I killed the app which created the folder. I am out of ideas.

Why is Windows 7 not letting me delete the folder?

studiohack

13.4k19 gold badges85 silver badges118 bronze badges

asked Oct 29, 2010 at 17:28

Tony_HenrichTony_Henrich

11.2k28 gold badges84 silver badges114 bronze badges

5

I am not sure why this happens but there is a workaround.

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:\Delete Me.

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.

Why is my computer telling me I need permission to delete something?

answered Oct 29, 2010 at 17:45

17

The only way was to delete files starting from the lowest level folder in that folder. I got that error message with every folder which had subfolders. I deleted all files/subfolders working my way up.

answered Oct 29, 2010 at 18:23

Tony_HenrichTony_Henrich

11.2k28 gold badges84 silver badges114 bronze badges

11

A folder can disallow a parent from overwriting its permissions, so it stops working at a certain depth.

Use Process Monitor and filter for ACCESS DENIED events to figure out this depth

Every time an ACCESS DENIED event occurs change the permissions as explained by @Sahil.


You can use Handle too see what processes are opening files within your folder.

handle C:\Path\To\Folder\You\Are\Trying\To\Delete

Example:

C:\Windows\system32>handle C:\Windows\System32\inetsrv

Handle v3.45
Copyright (C) 1997-2011 Mark Russinovich
Sysinternals - www.sysinternals.com

svchost.exe   pid: 1500  type: File  134: C:\Windows\System32\inetsrv\config\schema
svchost.exe   pid: 1500  type: File  1B4: C:\Windows\System32\inetsrv\config\schema
svchost.exe   pid: 1500  type: File  1BC: C:\Windows\System32\inetsrv\config
svchost.exe   pid: 1500  type: File  1CC: C:\Windows\System32\inetsrv\config
svchost.exe   pid: 1500  type: File  1D0: C:\Windows\System32\inetsrv\config
inetinfo.exe  pid: 1572  type: File  3C:  C:\Windows\System32\inetsrv\en-US\inetinfo.exe.mui
inetinfo.exe  pid: 1572  type: File  188: C:\Windows\System32\inetsrv\MBSchema.bin.00000000h
inetinfo.exe  pid: 1572  type: File  190: C:\Windows\System32\inetsrv\MBSchema.bin.00000000h
inetinfo.exe  pid: 1572  type: File  1BC: C:\Windows\System32\inetsrv\MetaBase.xml
inetinfo.exe  pid: 1572  type: File  1D4: C:\Windows\System32\inetsrv\MBSchema.xml
svchost.exe   pid: 1884  type: File  1AC: C:\Windows\System32\inetsrv\config\schema
svchost.exe   pid: 1884  type: File  1C0: C:\Windows\System32\inetsrv\config
svchost.exe   pid: 1884  type: File  1C4: C:\Windows\System32\inetsrv\config

answered Mar 1, 2011 at 16:02

Why is my computer telling me I need permission to delete something?

Tamara WijsmanTamara Wijsman

56.7k27 gold badges184 silver badges256 bronze badges

7

Had this issue today with a Windows Update folder and would like to supplement the answer.

When permissions on a folder are correct (example below, with Admin being the administrator account I was logged in with):

Why is my computer telling me I need permission to delete something?

But permissions on subfolders are different and do not propagate from the parent even though you tell them to, causing problems when trying to delete the parent folder:

Why is my computer telling me I need permission to delete something?

Open a command prompt (personally, I did not need to elevate the prompt) and run

ICACLS <FolderName> /reset /T

Why is my computer telling me I need permission to delete something?

To replace Access Control Lists with default ACLs, traversing all subfolders. After this try deleting the folder.

answered Jan 28, 2013 at 13:14

mxl_mxl_

1,1359 silver badges18 bronze badges

5

I had this issue and tried several of the answers here to no avail. However, I was able to simply delete the entire folder I was having problems with from an elevated command prompt like so:

rmdir "C:\path\to\folder" /s

Hope this helps someone.

answered Aug 31, 2016 at 14:25

Why is my computer telling me I need permission to delete something?

BryanBryan

7488 silver badges23 bronze badges

6

You can use Unlocker utility to delete such folders.

It is very simple to use and it is completely free.

answered Jul 30, 2014 at 13:03

Why is my computer telling me I need permission to delete something?

ani627ani627

3183 silver badges13 bronze badges

5

download SysInternals Suite and use the following utilities

use Process Explorer and Process Monitor to find out whats happening with your file

or use the following stand alone utils

use AccessChk to get details not easily available via the GUI

use PSFILE to scan for any process that is holding the file open then try the MoveFile utility to schedule a file delete in the next boot cycle.

The answer you're looking for will show up in the output of one of these utilities

answered Mar 1, 2011 at 15:59

klouckskloucks

2412 silver badges3 bronze badges

1

When I run into a folder/file I can't delete and rebooting doesn't free the file. I will add to the security setting of the file/folder the Everyone group and set the permissions to Deny Full Control. Then when I reboot the machine, what ever was using the file/folder starts, it won't be able to read/write or lock the file/folder. Finally with nothing being able to use the file/folder, you will be free to delete it.

Hope this helps.

answered Oct 30, 2010 at 18:53

No go with Windows 7 Ultimate x64. Finally had to boot from a USB-based linux OS (which ignores file permissions in NTFS file systems) and delete the offending directory that way.

answered May 8, 2011 at 22:17

1

I assume UAC is enabled and you are trying to delete the folder from Windows Explorer. You should run Windows Explorer as administrator (right click on the icon and select "Run as administrator") and then delete the folder.

The other alternative is to disable UAC, but I wouldn't recommend it.

answered Oct 29, 2010 at 17:32

ncardelincardeli

3261 silver badge4 bronze badges

2

Well, this happens for files that were installed by some kind installer, like under the TrustedInstaller user.

You need to pwn the file first,

  1. Right click the file, go to Properties/Security/Advanced.
  2. Owner tab/Edit/Change the owner to you (Administrator), save.
  3. Now you can go back to Properties/Security/ and assume Full Control over the file

answered Jan 17, 2014 at 14:41

Why is my computer telling me I need permission to delete something?

bobobobobobobobo

5,2128 gold badges45 silver badges61 bronze badges

Try moving the folder to your Desktop and deleting it there, odd, but has worked for me under similar circumstances.

answered Oct 29, 2010 at 18:26

TogTog

4,95714 gold badges37 silver badges42 bronze badges

I had the same issue (Windows required permission from user X, while being connected as user X…):

Why is my computer telling me I need permission to delete something?

I fixed it using unlocker (free, Microsoft Windows), then did:

Why is my computer telling me I need permission to delete something?

Why is my computer telling me I need permission to delete something?

After that, I could delete the directory without further issue.

answered Jul 17, 2016 at 16:57

Why is my computer telling me I need permission to delete something?

I had a folder that was completely hosed on Windows Server 2019. Couldn't take ownership, couldn't modify permissions, couldn't delete no matter what I tried.

Ended up being able to resolve it with the robocopy command using the /MIR switch with others.

robocopy \\source\data c:\data /R:10 /W:10 /MIR /SEC /EFSRAW /ZB /J /LOG:C:\LogFolder\logfile.log

I was syncing files and was able to clean up the same folder in the source location first, then /MIR deleted the folder in the source with the other switches above.

DISCLAIMER: /MIR will mirror source directory to destination, including deleting files in destination, so be sure you want destination to match source exactly before running it!

answered Nov 12, 2020 at 16:31

Why is my computer telling me I need permission to delete something?

lightwinglightwing

832 silver badges10 bronze badges

For me, git's bash.exe was holding my folder open, so I had to manually stop the bash tasks.

How to stop bash.exe tasks:

  1. Right-click the task bar
  2. Task Manager
  3. "Processes" tab
  4. Look for bash.exe
  5. For each bash.exe
    • Right-click > End Task

answered Jan 25, 2021 at 10:45

Why is my computer telling me I need permission to delete something?

Travis HeeterTravis Heeter

6511 gold badge8 silver badges20 bronze badges

Why does my computer say I need permission?

Thus, if your Windows user account doesn't have the correct privileges, you cannot access certain files or folders. When that happens, you'll encounter the "You need permission to perform this action" error message. It is frustrating, for sure.

How can I delete files that won't delete without permission?

How to delete files that won't delete.
Close apps. Often, the problem of a file that can't be deleted can be caused by an app that is currently using the file. ... .
Close Windows Explorer (File Explorer) That's the easy one out of the way. ... .
Reboot Windows. ... .
Use Safe Mode. ... .
Use a software deletion app. ... .
Bonus tip..