Take ownership of files

Associate
Joined
8 May 2022
Posts
41
Location
Bury
I want to delete a file on my secondary drive but i am getting an error message saying I do not have permission...well it's my comp so I do but ******** bill gates says I can not, how do i do it? Please don't advise me to go to youtube channels as they are full of **** I just want to delete a file ffs.
 
I'm writing this on my phone so can't verify this exactly but can you right click the file and go to properties. Then go to the security tab and then go to advanced. Under there you can change the owner of the file to administrators or your single admin account.

I think once you've done that you have to go back in to the security tab and then under permissions, add the administrators group or your admin account as full control and then you should be able to delete the file.

You can use the takeown command and then another to set permissions but I'd need my work laptop for that as I can't remember it off the top of my head! If you've not sorted it by tomorrow I'll get my batch file.
 
I'm writing this on my phone so can't verify this exactly but can you right click the file and go to properties. Then go to the security tab and then go to advanced. Under there you can change the owner of the file to administrators or your single admin account.

I think once you've done that you have to go back in to the security tab and then under permissions, add the administrators group or your admin account as full control and then you should be able to delete the file.

You can use the takeown command and then another to set permissions but I'd need my work laptop for that as I can't remember it off the top of my head! If you've not sorted it by tomorrow I'll get my batch file.
Yep you can right click then go to properties and advanced, did that and nothing changed, it’s a con.
 
Yep you can right click then go to properties and advanced, did that and nothing changed, it’s a con.
To clarify: You went into the Advanced Security Settings dialog for the file, changed the ownership to your logged in account, granted your logged in account Full Control, applied both changes and still get a permission denied error when trying to delete the file?

Did you also check permissions/ownership on the folder?

I would guess you are trying to delete the file in Windows File Explorer? Have you tried deleting it from an elevated command prompt (or an elevated File Explorer window)?
 
To clarify: You went into the Advanced Security Settings dialog for the file, changed the ownership to your logged in account, granted your logged in account Full Control, applied both changes and still get a permission denied error when trying to delete the file?

Did you also check permissions/ownership on the folder?

I would guess you are trying to delete the file in Windows File Explorer? Have you tried deleting it from an elevated command prompt (or an elevated File Explorer window)?
I tried it from the command prompt except the instruction only gave me error messages when i tried to follow the tutorial from the youtube clip, nothing works and I did all that in the advanced tab and it just says the same thing.
 
It’s not a standardised program that’s what, messes with registry and it does not always work, people have said it can be dangerous.
A bit late but that reg edit file is fine, I've used it for years without issue, usually to relink folders on a second drive after a reinstall. All it does is basically save you having to do the whole permissions/ownership routine via properties, advanced security, it just 'automatically' sets the file to allow admins access to the file(s).

Now editing the registry without backing it up and/or knowing what you're doing can be dangerous but in this case it's not doing anything to worry over, you can use something like notepad++ to open the .reg file and see exactly what it's changing.
 
Last edited:
Boot into a Linux USB (Ubuntu maybe) and you'll be able to delete just fine. That's a hammer to crack a nut though.

Have you tried the command takeown /F /R on the top level folder the file is in? or just takeown /F on the file if that's the specific thing you want to delete.
 
Back
Top Bottom