61

I downloaded a file from the internet (I can link to it here, but in the interests of not annoying other users, I won't post the link), and I can't delete the file with the message:

You need permission to perform this action You require permission from the computer's administrator to make changes to this file

Trouble is, I am the administrator and UAC is completely off.

If I go into the Properties/Security tab, I get the message

You do not have permission to view or edit this object's permission settings

Clicking "Advanced"/Owner, it says:

Current owner: Unable to display current owner.

If i try to change the owner, I get the same message:

Unable to set new owner on file Access is denied.
  • 2
    Did you check if its being used by another process? – Sevki Dec 6 '09 at 16:18
  • 3
    Using chkdsk /f in cmd in parent folder of it. I try and success! – Vuong Sep 23 '14 at 6:04
43

Give Unlocker a try. If there is any open file handle it will let you close it so you can successfully delete the file.

alt text

If that doesn't work for some reason, try BootDeleter. It will delete the file for you upon reboot, before Windows has a chance to lock it on you.

alt text

Both utilities are freeware.

  • 1
    Boot deleter did it. ty. – bobobobo Dec 7 '09 at 6:45
  • Boot deleter worked awesome! – Jorin Aug 18 '11 at 14:30
  • @Jorin glad to hear it :) – John T Aug 18 '11 at 14:31
  • 6
    Unlocker installs the Delta-toolbar and default search engine crap in all your internet browsers: superuser.com/questions/645329/… The "Recent Changes" feature in recent builds of the "Everything" file-system search engine allows you to see what other things Delta Search has broken: forum.voidtools.com/viewtopic.php?f=5&t=2129 – Jeroen Wiert Pluimers Sep 18 '13 at 8:22
  • 6
    To extend on @Jeroen's true comment: some 3rd party download sites even wrap more into the installer. Getting it from the Unlocker website gets one a 393K exe that already includes "Promotional feature: Fully optional Delta toolbar" since version 1.9.2. But a download from MajorGeeks is even 1.0M for the same version; who knows what that things installs... – Arjan Apr 26 '14 at 20:20
24

Sometimes it just won't let you change permissions because some process is using the file, or if you are trying to edit a folder's properties, then a process has a file that is within that dir or subdir open.

I had the problem described today, and I solved it by opening Process Explorer. Then, I went to the "Find" Menu, and selected the "Find Handle or DLL" option. In the dialog that comes up, I searched for the name of the folder I was having issues with. The search results told me which process had an open file within the folder. I killed the process, and then I had no problems with that folder's permissions.

  • 1
    Sometimes when IIS failed compilation of a web site DLL, administrator cannot delete or even change permission of the resulting file. Process explorer search also turns out empty. Doing iisreset in the command console unlocks the file, and strangely deletes it too, allowing us to recompile the file. – YudhiWidyatama Apr 9 '14 at 12:47
  • Certain applications, like Visual Studio, locks dirs in this way under circumstances which are a complete mystery (to me). Using Process Explorer (ctrl+F in it) and then closing all instances of VS I was able to finally remove some of these odd locked directories. – Grubl3r Nov 16 '17 at 10:45
11

Try Ultimate Windows Tweaker, which adds a "take ownership" element to the context menu.

alt text

Portable application, does not require an install.

  • 4
    This tool will not solve the problem. The underlying security issue is that Windows does not consider the user to have sufficient rights to take ownership, and this tool, while convenient, cannot subvert that. – Gavin May 20 '14 at 8:56
  • 2
    @Gavin What privilege do Administrators not have that they need to be granted? Under what circumstances would Windows not consider an Administrator as having insufficient rights to take ownership? – Ian Boyd Jan 28 '15 at 15:17
  • @IanBoyd When another process is using the file/folder, Windows will give authority to the process rather than the admin (as it seems, I don't know the inner reasons of this weird behavior). – gaborous Sep 19 '16 at 10:04
2

============================================================================ REPORTED ISSUE - Cannot take ownership of an NTFS folder via standard method

Folder Properties \ Security TAB \ Advanced button \ Change Owner

.

REPORTED ISSUE - CANNOT DELETE FOLDER or FILES,

.

========

SCENARIO

I get each time I try to perform ANY function with an NTFS folder called 'templates'.

CURENT RESULT - INFO: Access is denied. ( "G:\OLD Drive\Program Files\Microsoft Visual Studio x\ VC\VCWizards\CodeWiz.NET\Component\templates" )

============

TEST1 - FAIL

Followed enclosed instructions under proposed solution -

Download PsExec.exe from Sysinternals

C:\Windows\system32>TAKEOWN /F "G:\OLD Drive\Program Files" /R /D Y

===================================

RESULT (see INFO in last statement)

SUCCESS: The file (or folder): "G:\OLD Drive\Program Files" now owned by user "P
CDGROUP\PCD$".

SUCCESS: The file (or folder): "G:\OLD Drive\Program Files\Microsoft Visual Stud
io 8" now owned by user "PCDGROUP\PCD$".

SUCCESS: The file (or folder): "G:\OLD Drive\Program Files\Microsoft Visual Stud
io 8\VC" now owned by user "PCDGROUP\PCD$".

SUCCESS: The file (or folder): "G:\OLD Drive\Program Files\Microsoft Visual Stud
io 8\VC\VCWizards" now owned by user "PCDGROUP\PCD$".

SUCCESS: The file (or folder): "G:\OLD Drive\Program Files\Microsoft Visual Stud
io 8\VC\VCWizards\CodeWiz" now owned by user "PCDGROUP\PCD$".

SUCCESS: The file (or folder): "G:\OLD Drive\Program Files\Microsoft Visual Stud
io 8\VC\VCWizards\CodeWiz\.NET" now owned by user "PCDGROUP\PCD$".

SUCCESS: The file (or folder): "G:\OLD Drive\Program Files\Microsoft Visual Stud
io 8\VC\VCWizards\CodeWiz\.NET\Component" now owned by user "PCDGROUP\PCD$".

INFO: Access is denied. ( "G:\OLD Drive\Program Files\Microsoft Visual Studio 8\
VC\VCWizards\CodeWiz\.NET\Component\templates" )

C:\Windows\system32>

==========

CONCLUSION

Problem not resolved

===============

TEST2 - SUCCESS

CAVEAT - I was only able to succeed here because the folder sits on a drive that is not my primary boot (c:) and as such could be safely taken offline. I ensured all windows were closed before actioning.

Microsoft Windows [Version 10.0.10586]
(c) 2015 Microsoft Corporation. All rights reserved.

C:\Windows\system32> cd "G:\OLD Drive\Program Files\Microsoft Visual Studio 8\VC\VCWizards\CodeWiz\.NET\Component"

C:\Windows\system32>G:

G:\OLD Drive\Program Files\Microsoft Visual Studio 8\VC\VCWizards\CodeWiz\.NET\Component>chkdsk /f
The type of the file system is NTFS.
Cannot lock current drive.

Chkdsk cannot run because the volume is in use by another
process.  Chkdsk may run if this volume is dismounted first.
ALL OPENED HANDLES TO THIS VOLUME WOULD THEN BE INVALID.
Would you like to force a dismount on this volume? (Y/N) Y
Volume dismounted.  All opened handles to this volume are now invalid.
Volume label is DATABAK.

Stage 1: Examining basic file system structure ...
  986368 file records processed.
File verification completed.
  12 large file records processed.
  0 bad file records processed.

Stage 2: Examining file name linkage ...
  1261166 index entries processed.
Index verification completed.
  0 unindexed files scanned.
  0 unindexed files recovered to lost and found.

cd..

G:\OLD Drive\Program Files\Microsoft Visual Studio 8\VC\VCWizards\CodeWiz\.NET\

rd Component

======================================================

RESULT - The Component folder was successfully removed

1

I have had this issue a couple of times. Closing and restarting explorer resolved the issue. A quick and dirty solution, but it worked. http://www.howtogeek.com/198815/use-this-secret-trick-to-close-and-restart-explorer.exe-in-windows/

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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