|
1 | 1 | # Windows Image Repair |
2 | 2 |
|
3 | | -- [dism](https://learn.microsoft.com/en-us/windows-hardware/manufacture/desktop/deployment-image-servicing-and-management--dism--command-line-options?view=windows-11): repair system image using Windows Update to restore ucorrupted files |
4 | | - |
5 | | - - scan but not repair corruptions |
6 | | - ```batch |
7 | | - dism /Online /Cleanup-Image /CheckHealth |
8 | | - ``` |
9 | | - |
10 | | - - more advanced scan |
11 | | - ```batch |
12 | | - dism /Online /Cleanup-Image /ScanHealth |
13 | | - ``` |
14 | | - |
15 | | - - scan and repair common issues |
16 | | - ```batch |
17 | | - dism /Online /Cleanup-Image /RestoreHealth |
18 | | - ``` |
19 | | - |
20 | | - - use mounted installation media/iso to restore system files |
21 | | - ```batch |
22 | | - dism /Online /Cleanup-Image /RestoreHealth /Source:F:\sources\Install.esd /LimitAccess |
23 | | - ``` |
24 | | - |
25 | | - - _`%windir%\Logs\DISM\dism.log`_: generated detailed log |
26 | | -- [System File Checker](https://docs.microsoft.com/en-us/windows-server/administration/windows-commands/sfc): scan/repair all protected system files using the local image files at `%windir%\System32\dllcache` |
| 3 | +## DISM: Repair Windows Update corruptions |
| 4 | + |
| 5 | +[dism](https://learn.microsoft.com/en-us/windows-hardware/manufacture/desktop/deployment-image-servicing-and-management--dism--command-line-options?view=windows-11): repair system image using Windows Update to restore ucorrupted files |
| 6 | + |
| 7 | +- scan but not repair corruptions |
27 | 8 |
|
28 | 9 | ```batch |
29 | | - sfc /scannow |
| 10 | + dism /Online /Cleanup-Image /CheckHealth |
30 | 11 | ``` |
| 12 | + |
| 13 | +- more advanced scan |
31 | 14 |
|
32 | | - - if `sfc` returns `could not perform the requested operation` |
33 | | - - ensure folders exist _`%windir%\WinSxS\Temp\PendingDeletes`_, _`%windir%\WinSxS\Temp\PendingRenames`_ |
34 | | - - reboot into **safe mode** and rerun `sfc` |
35 | | - - _`%windir%\Logs\CBS\CBS.log`_: generated detailed log; extract sfc process details only with |
36 | | - ```batch |
37 | | - findstr /c:"[SR]" %windir%\Logs\CBS\CBS.log > "%userprofile%\Desktop\sfcdetails.txt" |
38 | | - ``` |
39 | | -
|
40 | | -- Cleanup Windows Update |
41 | | - |
42 | | - - analyze component store for removable updates |
43 | | - ```batch |
44 | | - dism /Online /Cleanup-Image /AnalyzeComponentStore |
45 | | - ``` |
| 15 | + ```batch |
| 16 | + dism /Online /Cleanup-Image /ScanHealth |
| 17 | + ``` |
| 18 | + |
| 19 | +- scan and repair common issues |
46 | 20 |
|
47 | | - - trigger cleanup |
48 | | - ```batch |
49 | | - dism /Online /Cleanup-Image /StartComponentCleanup |
50 | | - ``` |
| 21 | + ```batch |
| 22 | + dism /Online /Cleanup-Image /RestoreHealth |
| 23 | + ``` |
| 24 | + |
| 25 | +- use mounted installation media/iso to restore system files |
51 | 26 |
|
52 | | - - trigger more time consuming follow-up cleanup |
53 | | - ```batch |
54 | | - dism /Online /Cleanup-Image /StartComponentCleanup /ResetBase |
55 | | - ``` |
| 27 | + ```batch |
| 28 | + dism /Online /Cleanup-Image /RestoreHealth /Source:F:\sources\Install.esd /LimitAccess |
| 29 | + ``` |
| 30 | + |
| 31 | +- _`%windir%\Logs\DISM\dism.log`_: generated detailed log |
| 32 | + |
| 33 | +- more details at [Fix Windows Update errors by using the DISM or System Update Readiness tool](https://learn.microsoft.com/en-us/troubleshoot/windows-server/deployment/fix-windows-update-errors) |
| 34 | + |
| 35 | +## System File Checker: Repair Protected Operating System Files |
| 36 | + |
| 37 | +[System File Checker](https://docs.microsoft.com/en-us/windows-server/administration/windows-commands/sfc): scan/repair all protected system files using the local image files at `%windir%\System32\dllcache` |
| 38 | + |
| 39 | +```batch |
| 40 | +sfc /scannow |
| 41 | +``` |
| 42 | + |
| 43 | +- if `sfc` returns `could not perform the requested operation` |
| 44 | + - ensure folders exist _`%windir%\WinSxS\Temp\PendingDeletes`_, _`%windir%\WinSxS\Temp\PendingRenames`_ |
| 45 | + - reboot into **safe mode** and rerun `sfc` |
| 46 | +- _`%windir%\Logs\CBS\CBS.log`_: generated detailed log; extract sfc process details only with |
| 47 | + ```batch |
| 48 | + findstr /c:"[SR]" %windir%\Logs\CBS\CBS.log > "%userprofile%\Desktop\sfcdetails.txt" |
| 49 | + ``` |
| 50 | + |
| 51 | +## Cleanup Windows Update |
| 52 | + |
| 53 | +- analyze component store for removable updates |
| 54 | + ```batch |
| 55 | + dism /Online /Cleanup-Image /AnalyzeComponentStore |
| 56 | + ``` |
| 57 | + |
| 58 | +- trigger cleanup |
| 59 | + ```batch |
| 60 | + dism /Online /Cleanup-Image /StartComponentCleanup |
| 61 | + ``` |
| 62 | + |
| 63 | +- trigger more time consuming follow-up cleanup |
| 64 | + ```batch |
| 65 | + dism /Online /Cleanup-Image /StartComponentCleanup /ResetBase |
| 66 | + ``` |
0 commit comments