# Take ownership complication

1. ## Take ownership complication

Hi,

I might have done something very very stupid.

Well, whenever i had a problem with permissions, if i used the take ownership context menu option, it would allow me to do whatever i wanted with the file. So i figured it would be a good idea to take ownership of both Program Files folders, my games folders, users folders, and documents and settings folder.

Nothing horrible happened, aside from the fact that Steam, Logitech gaming framework (driver to make g930 work) and Skype no longer start with Windows like it used to. Maybe even more stuff that used to load doesn't load anymore, but those three are easier to check since they have tray icons. Any way to fix that?

And no, i don't have a restore point.

My System Specs

2. Make a restore point first and then look at this thread

How to reset all user permissions to default? - Microsoft Community

Say if you have an issue but I checked and the links are still valid.
My System Specs

3. I have used TakeOwnership context menu on both Program Files folders without issues. Probably because mine is the only user account on the system. Since you have no registry backup the safest bet may be to make a Restore Point now as safeguard against changes. Then it may be ok to experiment with changing the ownership back on the other folders. Perhaps someone knows the correct default(I'm not sure if it should be Administrator or SYSTEM or some other.)

The other approach may be to uninstall then reinstall the software. I'm not a gamer so I don't know how involved that is. Perhaps a next to last resort.
My System Specs

I'm not sure if it should be Administrator or SYSTEM or some other
MS say both but who knows...
subinacl /subkeyreg HKEY_LOCAL_MACHINE /grant=system=f
subinacl /subkeyreg HKEY_CURRENT_USER /grant=system=f
subinacl /subkeyreg HKEY_CLASSES_ROOT /grant=system=f
subinacl /subdirectories %SystemDrive% /grant=system=f
The other approach may be to uninstall then reinstall the software. I'm not a gamer so I don't know how involved that is. Perhaps a next to last resort.
probably a better idea.
My System Specs

5. Well, apparently this issue is extending to other things. Some icons are not showing at all, if i start up my computer, go to my computer, browse a folder and come back to my computer, it takes a LONG time to show the drives. Also, whenever i went to install subinacl to system32, it would show system32 but would change to syswow64. I had to manually unzip subinacl and place it in system32 for this to work. Will post back results.

Edit: I just rebooted my PC after resetting the permissions and the issue persists. I can't even click properties on a folder.

I'm going to run SFC /scannow and DISM. Starting to think this has nothing to do with permissions, though the issues did start after changing them. Also shows that indexing is not running for some reason.
My System Specs

6. So, CBS reports some files are corrupted and could not be fixed. I analyzed a bit of the log, and from what i could tell there seems to be some issues with permissions.

The log is attached with this post.
My System Specs

7. If subinacl is 32 bit then it would be redirected to SysWow64. As counterintuitive as it sounds System32 if for 64 bit system files on x64 systems. SysWow64 is the folder for the 32 bit emulation.

If you made the restore point as suggested now may be the time to use it.
My System Specs

8. I just saw in task manager that it shows Explorer.exe is not responding, though it is kind of working aside from the glitches i described.

Thought that was worthy of mention.

Edit: Added a picture showing the issue.
Desktop has no problems showing icons.
My System Specs

9. Finally i have fixed this by resetting permissions with ICACLS. I tried all other ways, only ICACLS worked. I'm so glad this wasn't file corruption of any sort.

So, to fix this:
Open CMD as admin, type CD /d C:/ (C being the letter of the drive in question you want to reset ownership to), then type icacls * /T /Q /C /RESET

As it progressed, the programs i had on startup started themselves, and everything was working fine again. Probably had to do with me taking ownership of the documents and settings folder, best leave that one alone.

Also, if the above commands don't work, you can try this in an ELEVATED CMD:

takeown /f "C:\path\to\folder" /r
icacls "C:\path\to\folder" /reset /T
My System Specs

Thanks for posting the solution.
My System Specs

Take ownership complication
I have a problem with taking ownership of C:\Windows\System32\termsrv.dll. When I run my script from a elevated powershell prompt : $dir = 'C:\Windows\System32\termsrv.dll'$domain = $env:USERDNSDOMAIN$user = \$env:USERNAME