bypassing permission denied on editing files

Started by Metgod, October 04, 2004, 10:57:25 AM

Previous topic - Next topic
October 04, 2004, 10:57:25 AM Last Edit: October 04, 2004, 11:09:49 AM by Metgod
Ok, so I had installed cygwin to help someone.. come to my surprise that I could not delete certain files after I installed it and wanted to get rid of it.

Instead, I got a message saying :

Cannot delete <file>: Access is denied. The source file may be in use.

So I tried a command prompt, tried safe mode and command prompt and both failed...

So I then tried Symantec's wipe utility that is part of their anti virus program. It also failed.

So I had no other immediate choice but to figure out how to bypass this nonsense (since I am the bloody administrator).

Here's how I did it.

I right-clicked on the file and then leftclicked on properties.

Then I clicked on the security tab. Then I got a message saying "You only have permission to view the current security information on <file>."

I then clicked ok, went to advanced, then the owner tab, and clicked on my user name. Then hit Apply and then Ok.

Then I clicked ok again to close properties (I had to do that first as I couldn't do the next step unless I open it again).

Then I opened up properties again. Went to Security and clicked on the checkbox showing "Allow inheritable permissions from parent to propogate to this object."

Clicked apply and now the permissions have changed to that of the parent directory. I can now delete the file, change permissions, etc.

It is a pain, but sometimes you have to do these things I guess.

I don't know if there is any utility that'd make this quicker. My unix system is a completely different computer so I could not just mount my disk and remove the files in unix, so this was the only solution.

Hope it helps someone sometime down the road..

Btw, this would only work if you can change the user name of the owner (which seems strange to me, since you don't have permission to change the attributes but you do have permission to change the owner) and if the parent directory is something you can edit.


"My Terminal is my Soul"

Thanks a lot for this solution. I have been looking up and down trying to find a way to backup my files to another computer.

Glad it helped.

I forgot about this post. But I am still wondering why cygwin has it this way ....

Oh well.

"My Terminal is my Soul"

if you have ntfs filesystem you can do this instead. you need to be the administrator of the computer.

cacls /? to see it all.

cacls filename : to see the current acl's
cacls filename /T /E /G domain\user:permissions to grant your self permissions.
where /T stands for changing perm's in the directory as well as its sub dir's.
/E is to edit the acls instead of replacing them
/G is to grant.

permissions can be N (none) R (rd only) F (full) and other two i forgot. check the cacls /? out you will understand.

SMF spam blocked by CleanTalk