WindowsAppsUnfukker icon indicating copy to clipboard operation
WindowsAppsUnfukker copied to clipboard

Access is denied on psexec as admin.

Open yossi2010 opened this issue 4 years ago • 8 comments

My account can't open windows apps (windows can't access path or device) such as Nvidia control panel or Forza 5, yet a new account can. (and I have fucked around with the permissions before)

Tried using psexec locally on an admin CMD and an admin PS, I even tried adding -h and I get Access is denied. How can you get Access is denied on a SYSTEM level execution?

I wish for a fix. Thank you for your effort making this script!!!!!

Output:

Backup of existing permissions... Successfully processed 0 files; Failed processing 8 files Saved to C:\Program Files\WindowsApps_20211201_121131.txt

Fixing WindowsApps permissions... [RED TEXT] . . . Get-ChildItem : Could not find a part of the path 'C:\Program Files\WindowsApps\SUPERHOTTeam.533673F36228B_1.2.13.0_x64__hj98apedv0ctt'. At C:\Utilities\WindowsAppsUnfukker-main\WindowsAppsUnfukker.ps1:110 char:18

  • ... pxFolders = Get-ChildItem $WinAppsPath -Filter 'AppxMetadata' -Depth ...
  •             ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    
    • CategoryInfo : ReadError: (C:\Program File...__hj98apedv0ctt:String) [Get-ChildItem], DirectoryNotFound Exception
    • FullyQualifiedErrorId : DirIOError,Microsoft.PowerShell.Commands.GetChildItemCommand

[end of RED TEXT]

Fixing WindowsApps subfolders inheritance... Successfully processed 270 files; Failed processing 1 files

Fixing WindowsApps subfolders permissions...

Fixing AppData Packages permissions, this could take a couple minutes... C:\Users\Cohen\AppData\Local\Packages: Access is denied. C:\Users\Cohen\AppData\Local\Packages*: Access is denied. Successfully processed 0 files; Failed processing 2 files C:\Users\Cohen\AppData\Local\Packages: Access is denied. Successfully processed 0 files; Failed processing 1 files

yossi2010 avatar Dec 01 '21 10:12 yossi2010

Huh, that's weird... I think I know what's wrong for Superhot, but I'm confused about the AppData errors. Can you provide a screenshot of the Security > Advanced panel for C:\Users\Cohen\AppData\Local\Packages?

AgentRev avatar Dec 02 '21 18:12 AgentRev

It is owned by my user and only my user is listed in the permissions list as "full access"

yossi2010 avatar Dec 02 '21 23:12 yossi2010

Normally, the Packages folder is supposed to inherit SYSTEM Full control from C:\Users\Username, you must have fukked it beyond what the script can handle 😂

AgentRev avatar Dec 03 '21 09:12 AgentRev

well I get “Failed to Enumerate Objects in the Container. Access is denied.” when trying to apply the root user security values to the subfolders.

same as when I try to change the security settings on the WindowsApps

FFS how can my access be denied if I'm the damn Admin???? Linux will self destruct if I tell it so with admin privileges. Going to safe mode to try and fix it from there.

yossi2010 avatar Dec 03 '21 09:12 yossi2010

Maybe try running the script without psexec? (remove the SYSTEM user verification from the script)

AgentRev avatar Dec 03 '21 09:12 AgentRev

Going to safe mode to try and fix it from there. doing this fixed the issue without having to run the unfukker. Apparently if SYSTEM (and administrators) don't have access to appdata/packages it is bad. So I appllied the appdata security settings to all the subfolders and it fixed the "windows can't access path or device" (just like it is on the new account I made).

yossi2010 avatar Dec 03 '21 11:12 yossi2010

OMG thank you for the hints! I clicked the "Enable Inheritance" button for "C:\Users\username\AppData\Local\Packages" which added the SYSTEM permissions automatically, then I re-ran unfukker. Everything finally works and the script didn't have any errors. Finally my windows store apps can start more than once without breaking. Windows 11 btw.

vgf89 avatar Apr 07 '22 07:04 vgf89

I'm having a somewhat similar issue. I am trying to make one small change to a WindowsApps\ file (basically just renaming it with ren), and I don't want to fukk up the permissions, so I tried doing it with PSEXEC. Even though I'm in the PSEXEC shell, and running whoami returns "nt authority\system", attempting ren on a file in WindowsApps returns "Access is denied." If I go to file permissions, I see that SYSTEM does have full permissions, as expected (this is a brand new PC, so no chance to get fukked up yet). Any suggestions?

e-t-l avatar Nov 09 '23 01:11 e-t-l