W4RH4WK / Debloat-Windows-10

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

Sfc scannow & dism image restore #74

Closed jrtoman closed 7 years ago

jrtoman commented 7 years ago

I just noticed that I can no longer fun sfc /scannow now or dism image restore due to complaint mainly that it can't connect to the windows update server.

W4RH4WK commented 7 years ago

Ensure the windows update service is enabled and clear the related firewall rules / hosts entries. A bunch of hosts are blocked because of telemetry, but some of the IPs / domains be infrastructure related.

jrtoman commented 7 years ago

will these firewall rules only apply windows defender? I currently use avast

W4RH4WK commented 7 years ago

The firewall rules apply only to the windows firewall, the entries in %windir%\system32\drivers\etc\hosts will be used by the entire system.

jrtoman commented 7 years ago

Look's like it the remove onedrive script that is breaking both sfc and dism...Only way to fix the issue is to do a windows upgrade repair

saper-2 commented 7 years ago

Hi, I had similar problem recently but I didn't removed onedrive (just disabled telemetry & removed crapware). I'm pretty sure this started after upgrade to 1607. WU didn't want to connect to update server (It was complaining about metered connection or "try later" ). I'm using WFC as controller of windows firewall (other FW are too expensive, too old or too "dumb" for me), when I disabled FW completely WU started to work. So I had to reset windows firewall, and then add all (accept or decline) programs & services again - including system too (svchost & others).

W4RH4WK commented 7 years ago

The block-telemetry.ps1 script adds one single rule to the firewall, containing 9 IPs (at the moment). If you disable / remove that rule it should work again. Otherwise the firewall is not the (only) problem.

jrtoman commented 7 years ago

I'm using a third party antivirus which is probably why i haven't noticed the telemetry blocking issue you had. Mine was narrowed down specifically to the onedrive removal script and was easily repeatable on my system.

saper-2 commented 7 years ago

I keep OneDrive, so I can't confirm this one. But the rule that block telemetry IPs is OK too. In my case helped reset of FW rules, probably there is some new middle-man services and that was blocked on my FW (since I had set to not being notified by windows services so I never got prompt).

I just exec block-telemetry.ps1 (commented out host file modification because my host file is modified already) and WU still checks OK after adding FW rule with IPs.

W4RH4WK commented 7 years ago

If the OneDrive removal script really causes this issue, I have no clue why. Looking at the script I can only imagine stuff breaking behind the curtains. If anyone has a solution or even an idea, I'd be glad.

W4RH4WK commented 7 years ago

Anything new about this issue?

nwmcsween commented 7 years ago

Windows expects the cab files to be present in winsxs for sfc /scannow, I had to dig through an ISO and copy over the missing cab files so sfc would complete after running onedrive with the debloat script.

W4RH4WK commented 7 years ago

Glad to here you got it working. Does that resolve the issue?