AgentRev / WindowsAppsUnfukker

PowerShell script to fix WindowsApps-related permission errors and crashes.
The Unlicense
356 stars 20 forks source link

Access is denied on psexec as admin. #3

Open yossi2010 opened 2 years ago

yossi2010 commented 2 years ago

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

[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

AgentRev commented 2 years ago

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?

yossi2010 commented 2 years ago

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

AgentRev commented 2 years ago

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 😂

yossi2010 commented 2 years ago

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.

AgentRev commented 2 years ago

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

yossi2010 commented 2 years ago

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).

vgf89 commented 2 years ago

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.

e-t-l commented 8 months ago

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?