W4RH4WK / Debloat-Windows-10

A Collection of Scripts Which Disable / Remove Windows 10 Features and Apps
Other
6.03k stars 853 forks source link

Modifying files in C:\Windows\WinSxS\ breaks Windows Update and system file checker (sfc) #297

Closed WayneSherman closed 2 years ago

WayneSherman commented 2 years ago

After running these scripts, I have experienced broken Windows update and broken system file checker (sfc /scannow fails to repair). I expended much effort trying to repair the systems which were affected, but ended up having to do a fresh install of Windows.

I finally discovered the cause was the "remove-onedrive.ps1" script was deleting files in the WinSxS folder.

Please remove these lines: https://github.com/W4RH4WK/Debloat-Windows-10/blob/80da8e56751f83da190a6a1bf74f9778f7a56ef8/scripts/remove-onedrive.ps1#L58-L62

For reference, here are warnings from three different sources:

https://www.tenforums.com/general-support/155313-winsxs-folder-outdated-hardware.html You should never ever manually delete anything in WinSxS or you risk breaking the system. The only safe way to clean up WinSxS is with the tools MS provide.

https://superuser.com/questions/1621421/can-i-safely-delete-all-inside-the-c-windows-winsxs-temp-folder-only Don't manually replace winsxs files (or even touching winsxs). The supported mechanism is technet.microsoft.com/en-us/library/Dn251565.aspx Definitely do not mess with winsxs. Some of the versions may be removable by running dism /online /cleanup-image /startcomponentcleanup. Anything that remains after that should be left alone

https://www.ionos.com/digitalguide/server/configuration/winsxs-cleanup/ Most importantly, however, you should never manually delete files from the WinSxS folder. This can significantly affect your system's ability to function.

WayneSherman commented 2 years ago

These two issues are probably for the same reason: Issue #248 and Issue #288

W4RH4WK commented 2 years ago

Thanks for figuring out what caused the issue. Hope this is sufficient.