Question: Using Windows 10 - Pro, was in the process of installing a software on a local folder in `C:/apps` .
Now that folder has got locked - unable to open it.
I am admin on the machine - its a personal laptop.
Cant open the folder in Cmd or W.Explorer. In Cmd it says 'access denied" , in Explorer it shows 'read only" - cant click it open. I try unchecking the the readonly checkbox - it will uncheck but still not work, will go back - still checked.

[![enter image description here](https://i.stack.imgur.com/tjsqM.jpg)](https://i.stack.imgur.com/tjsqM.jpg)

I can access the folder using Powershell/admin. If I run ACL on the directory shows full Access

```
PS C:\apps> Get-Acl c:\apps | Format-List

Path   : Microsoft.PowerShell.Core\FileSystem::C:\apps
Owner  : SB-DL-19\sbaha
Group  : SB-DL-19\sbaha
Access : NT AUTHORITY\SYSTEM Allow  FullControl
         NT AUTHORITY\LOCAL SERVICE Allow  FullControl
         BUILTIN\Administrators Allow  FullControl
Audit  :

```

Tried giving access using PS:

```
PS C:\apps> $acl = Get-Acl c:\apps
PS C:\apps> $owner = New-Object System.Security.Principal.NTAccount("BUILTIN\Administrators")
PS C:\apps> $acl.SetOwner($owner)
PS C:\apps> Get-Acl c:\apps | Format-List

```

Nothing changed.

I cant open the folder in CMD (without admin) or Explorer?

Further the software stored some config in `C:\WINDOWS\system32\config\systemprofile\AppData\Local\` - so also cant access `C:\WINDOWS\system32\config\`

Answer: 
Found this nugget use Powershell/Admin
`Get-Acl 'known-good-folder' | Set-Acl 'problem-folder'`  - **This worked**

Will do the same to to \config folder
Open Command Prompt as Administrator. Then run `takeown /f "File or folder path"` and then run `icacls "File or folder path" /grant Users:F` to grant full access to the local Users group.