Cannot write to directory after taking ownership

0

I had a directory on an internal hard-drive that was created in an old Windows 7 install. After re-installing my operating system, when I try to create a new directory inside that directory, I get an Access Denied message. This isn't a protected directory, just a random directory I created at the drive root (that drive was not the C drive in either install).

I tried to take ownership by opening folder properties, going to the Security tab, clicking on Advanced, going to Owner tab, clicking on Edit, selecting my user account, checking Replace owner on subcontainers and objects, and clicking Apply. There were no error messages and I closed the dialogs. I rebooted, checked the owner on that folder and a couple subfolders and it appears to be set correctly. I am still getting an Access Denied message however when trying to create a directory in it.

I've also tried using attrib -R . to remove any possible readonly attribute inside the directory in an admin command prompt but am still unable to create a directory using a non-admin prompt (it does work in an admin prompt).

Is there anything I can do to get write access to that folder and it's subcontents in a non-elevated context without disabling UAC?

jeff charles

Posted 2012-06-30T20:43:32.563

Reputation: 103

Nevermind, it looks like something weird happened due to Sharing. I enabled sharing to my user account, then disabled sharing, and for some reason that gave me write-access to the folder and it's subcontents. – jeff charles – 2012-06-30T20:54:06.653

If you solved the problem, put in in the Answer field at the bottom, then mark as the correct answer after a couple days – Canadian Luke – 2012-06-30T21:00:07.560

@Luke - I would've put it in the Answer field except I got a message saying I didn't have enough rep to do that and had to wait 8 hours ... I'm not sure what the preferred thing to do in that case is – jeff charles – 2012-07-01T18:03:09.380

Answers

2

Ownership is not enough. You also have to change the folder's ACL to gain write privileges. Looks like enabling sharing fixed these privileges for you. Rebooting is not necessary and the read only flag on a folder does not prevent creating files in it.

Gurken Papst

Posted 2012-06-30T20:43:32.563

Reputation: 3 874

At the time, I don't think my user account was appearing in the permission entries and the "Effective Permissions" suggested my account had full control. Next time (if there is a next time), I will look closer. The reboot and the readonly check was just to rule those out since I wasn't sure what was going on. – jeff charles – 2012-07-01T18:12:38.697

0

Nevermind, it looks like something weird happened due to Sharing. I enabled sharing to my user account, then disabled sharing, and for some reason that gave me write-access to the folder and it's subcontents.

jeff charles

Posted 2012-06-30T20:43:32.563

Reputation: 103