Klocman / Bulk-Crap-Uninstaller

Remove large amounts of unwanted applications quickly.
https://www.bcuninstaller.com/
Apache License 2.0
11.91k stars 594 forks source link

ScriptHelper gets error 59 during deletion #488

Open blank-teer opened 1 year ago

blank-teer commented 1 year ago

ScriptHelper.log says System.UnauthorizedAccessExeption: Cannot write to the registry key

Klocman commented 1 year ago

Is there an actual bug or is it only in the log? Please share the full log file.

blank-teer commented 1 year ago

it happens when im trying to run the deleters like Decreased Wallpaper quality (high compression) or Subscribed content (Auto-install suggested apps)

10:10:56 AM - System.UnauthorizedAccessException: Cannot write to the registry key. at Microsoft.Win32.RegistryKey.EnsureWriteable() at Microsoft.Win32.RegistryKey.SetValue(String name, Object value, RegistryValueKind valueKind) at ScriptHelper.Tweaks.<>c.<.cctor>b04(Boolean ) at ScriptHelper.Program.Main(String[] args) 10:11:18 AM - System.UnauthorizedAccessException: Cannot write to the registry key. at Microsoft.Win32.RegistryKey.EnsureWriteable() at Microsoft.Win32.RegistryKey.SetValue(String name, Object value, RegistryValueKind valueKind) at ScriptHelper.Tweaks.<>c.<.cctor>b02(Boolean ) at ScriptHelper.Program.Main(String[] args)

Klocman commented 1 year ago

What Windows version are you on?

blank-teer commented 1 year ago

win11 pro 22H2

Klocman commented 1 year ago

I'm guessing some registry permissions changed in Win11 for some reason. I don't have any W11 systems so I can't test it at the moment.

BraINstinct0 commented 1 year ago

Currently on windows 11, any scripts you might want me to run to test?

tonyping commented 1 year ago

I can confirm that I'm running into the same issues here: "System.UnauthorizedAccessException: Cannot write to the registry key" error in the logs. I'm running Windows 11 Insiders, canary build 25905.rs_prerelease.

Fwiw, I was also running the Wallpaper compression disabling script, but seeing as the issue is related to systems permissions, it's reasonable to just assume that it's going to affect at least some; if not all of them, as they all do write to some key areas of the registry.

I do have the Virtualization-based protection and Core Isolation features enabled, so this also might contribute to the restrictions. But seeing the way this error just sprung up on Win11, I'm going to put my best guess on Microsoft adding some changes to Win11 that now protects some areas of the registry from outside modifications.