File I can't take ownership of

61

18

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.

bobobobo

Posted 2009-12-06T16:08:21.503

Reputation: 4 632

3Using chkdsk /f in cmd in parent folder of it. I try and success! – Vuongg – 2014-09-23T06:04:32.667

2Did you check if its being used by another process? – Sevki – 2009-12-06T16:18:43.350

Answers

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.

John T

Posted 2009-12-06T16:08:21.503

Reputation: 149 037

WOW! I didnt know we have such POWERFUL tools out there... BOOT Deleter ? I dont believe .... – UltraDEVV – 2014-09-23T06:15:50.607

I have found LockHunter first, and hoping that performs a similar task well enough as Unlocker. Maybe even better without the adware? I have also just used a link that explained Computer Management having an Open Files view, and neither method showed any locks in my weird ownership security / lack of permissions bug in my folder case. – Pysis – 2017-12-21T03:42:59.147

Boot deleter worked awesome! – Jorin – 2011-08-18T14:30:39.637

@Jorin glad to hear it :) – John T – 2011-08-18T14:31:28.183

6

Unlocker installs the Delta-toolbar and default search engine crap in all your internet browsers: http://superuser.com/questions/645329/delta-search-spy-malware-removal-cannot-install-run-anything 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: http://forum.voidtools.com/viewtopic.php?f=5&t=2129

– Jeroen Wiert Pluimers – 2013-09-18T08:22:02.320

1Boot deleter did it. ty. – bobobobo – 2009-12-07T06:45:44.197

6To 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 – 2014-04-26T20:20:57.053

25

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.

Eddified

Posted 2009-12-06T16:08:21.503

Reputation: 1 440

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 – 2017-11-16T10:45:39.223

1Sometimes 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 – 2014-04-09T12:47:48.723

11

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

alt text

Portable application, does not require an install.

outsideblasts

Posted 2009-12-06T16:08:21.503

Reputation: 6 297

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 – 2015-01-28T15:17:08.337

@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 – 2016-09-19T10:04:51.453

6This 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 – 2014-05-20T08:56:14.343

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

Thomas Allan

Posted 2009-12-06T16:08:21.503

Reputation: 21

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/

Stuart O'Reilly

Posted 2009-12-06T16:08:21.503

Reputation: 11