Problems with DISM


You should run the DISM command first.
DISM /Online /Cleanup-Image /RestoreHealth

Then sfc /scannow

Reason is running DISM first repairs the underlying image that SFC relies on to get repair files from.

If the image has corruption and you run SFC first you are potentially replacing good files with corrupted ones from a bad source (Image).
 

My Computer

System One

  • OS
    Windows 11 Pro
why not just ignore sfc and run DISM /Online /Cleanup-Image /RestoreHealth /Source:WindowsUpdate
 

My Computers

System One System Two

  • OS
    Windows 11 Pro 25H2 26200.8524
    Computer type
    Laptop
    Manufacturer/Model
    Acemagic LX15PRO
    CPU
    AMD Ryzen 7 5825U with Radeon Graphics
    Memory
    16GB
    Screen Resolution
    1920 x 1080
    Hard Drives
    SSD 2TB
    Internet Speed
    30 Mbps
    Browser
    Brave
    Antivirus
    Webroot Secure Anywhere
    Other Info
    System 3

    Acer Swift SF114-34 laptop
    OS Windows 11 Pro 26200.8524
    CPU Pentium Silver N6000
    RAM 4GB
    SSD Samsung 970 EVO Plus SSD 2TB (an upgrade)
  • Operating System
    Windows 11 Pro 23H2 22631.2506
    Computer type
    Laptop
    Manufacturer/Model
    HP Mini 210-1090NR PC (bought in late 2009!)
    CPU
    Atom N450 1.66GHz
    Memory
    2GB
    Browser
    Brave
    Antivirus
    Webroot
why not just ignore sfc and run DISM /Online /Cleanup-Image /RestoreHealth /Source:WindowsUpdate
By default DISM /Online /Cleanup-Image /RestoreHealth repairs corrupted system files by checking the Windows image for damage and automatically downloading replacements from Windows Update.

No need for the WU switch as WU is already used by default.

Only time you need to use the source switch is if pointing to install.wim or some other local source.
 

My Computer

System One

  • OS
    Windows 11 Pro
No, that's not correct. It will use WU, but that is not the default.
 

My Computers

System One System Two

  • OS
    Windows 11 Pro 25H2 26200.8524
    Computer type
    Laptop
    Manufacturer/Model
    Acemagic LX15PRO
    CPU
    AMD Ryzen 7 5825U with Radeon Graphics
    Memory
    16GB
    Screen Resolution
    1920 x 1080
    Hard Drives
    SSD 2TB
    Internet Speed
    30 Mbps
    Browser
    Brave
    Antivirus
    Webroot Secure Anywhere
    Other Info
    System 3

    Acer Swift SF114-34 laptop
    OS Windows 11 Pro 26200.8524
    CPU Pentium Silver N6000
    RAM 4GB
    SSD Samsung 970 EVO Plus SSD 2TB (an upgrade)
  • Operating System
    Windows 11 Pro 23H2 22631.2506
    Computer type
    Laptop
    Manufacturer/Model
    HP Mini 210-1090NR PC (bought in late 2009!)
    CPU
    Atom N450 1.66GHz
    Memory
    2GB
    Browser
    Brave
    Antivirus
    Webroot
There may be some truth in what you say and we may be at cross purposes. My understanding is this.

DISM /Online /Cleanup-Image /RestoreHealth operates on the online Windows installation and primarily uses the Windows component store (C:\Windows\WinSxS) to check for corruption and repair system files. By default, it will attempt to use Windows Update as a source if it needs replacement files that are missing or corrupted in the component store. If the component store itself is damaged, you can specify an alternate source with the /Source option.

So in short: the component store is always involved; Windows Update is only used if necessary.
 

My Computers

System One System Two

  • OS
    Windows 11 Pro 25H2 26200.8524
    Computer type
    Laptop
    Manufacturer/Model
    Acemagic LX15PRO
    CPU
    AMD Ryzen 7 5825U with Radeon Graphics
    Memory
    16GB
    Screen Resolution
    1920 x 1080
    Hard Drives
    SSD 2TB
    Internet Speed
    30 Mbps
    Browser
    Brave
    Antivirus
    Webroot Secure Anywhere
    Other Info
    System 3

    Acer Swift SF114-34 laptop
    OS Windows 11 Pro 26200.8524
    CPU Pentium Silver N6000
    RAM 4GB
    SSD Samsung 970 EVO Plus SSD 2TB (an upgrade)
  • Operating System
    Windows 11 Pro 23H2 22631.2506
    Computer type
    Laptop
    Manufacturer/Model
    HP Mini 210-1090NR PC (bought in late 2009!)
    CPU
    Atom N450 1.66GHz
    Memory
    2GB
    Browser
    Brave
    Antivirus
    Webroot
The component store is involved because that's what is being scanned for corruption. It can't get replacement files from the component store if that's what is corrupted.

The source for correct files is whatever Features on Demand is configured to use. That's Windows Update by default and if allowed by policy. You can also use a mounted WIM, a shared \Windows folder from a working PC on the network, Windows installation files like you would find in the ISO, etc.

 

My Computer

System One

  • OS
    Windows 11 Pro 25H2
    Computer type
    PC/Desktop
    Manufacturer/Model
    Intel NUC12WSHi7
    CPU
    12th Gen Core i7-1260P
    Motherboard
    NUC12WSBi7
    Memory
    64 GB Micron PC4-25600
    Graphics Card(s)
    Intel Iris Xe Graphics
    Sound Card
    on-board Realtek HD Audio
    Monitor(s) Displays
    Dell U3219Q
    Screen Resolution
    3840 x 2160
    Hard Drives
    Samsung SSD 990 PRO 1TB
    Crucial MX500 2 TB
    Antivirus
    Microsoft Defender
Do you know why we don't execute Dism /Online /Cleanup-Image /RestoreHealth command from recovery environment?
Because of the /Online switch and you are not inside the windows environment but inside the recovery environment. Normal Windows has not been started. The 2 commands I gave only works if your system has booted with Windows.

In a recovery environment you have to tell where Windows "lives".
(It does not know at that moment. De X-drive is a symbolic link towards the C-drive. With other words X and C are the same.)

You have to alter the DISM command into:
X:\Windows\System32>Dism /Image:C:\ /ScratchDir=C:\Windows\Temp /Cleanup-Image /RestoreHealth

If you leave out the /ScratchDir argument it will complain. (because it's afraid that there in enough space.)

The scratch directory size might be insufficiënt to perform this operation. This can cause unexpected behavior.
Use the /ScratchDir option to point to a folder with sufficient scratch space. The recommended size is at least 1024 Mb.
It does not matter if you use this option or not. It will not write any files to that location.
But you can see the results in the C:\Windows\Logs\CBS\CBS.log file and C:\Windows\Logs\DISM\dism.log file if you want. (using notepad. Leave out the .exe part) When in the Recovery Environment go to: Solve Problems - Advance options - CommandPrompt and simply execute the mentioned command.


Edit: Just found this out; SFC /Scannow inside a Recovery Environment is untrustworthy. It keeps finding problems. Go to Windows? SFC: No problems. Back again in the Recovery Environment? SFC: Problems. Executing a second time inside the Recovery Environment; It will refuse. There are repairs pending. Go To Windows? SFC: No Problems. Recovery? SFC: Problems. It seems to me that this command is not fit to be executed inside a recovery environment. It always report errors and fixed them. No evidence that it wrote into CBS.log as mentioned. Would avoid executing it.
 
Last edited:

My Computer

System One

  • OS
    Win 11 Pro "25H2" Build 26200.8524, Zorin OS Pro
    Computer type
    PC/Desktop
    Manufacturer/Model
    Self built
    CPU
    Intel® Core™ i7-12700KF 12th Gen.
    Motherboard
    ASUS Prime Z690-A, BIOS v4505
    Memory
    32GB DDR5 5600-36 Vengeance
    Graphics Card(s)
    PCIe4.0 Asus NVIDIA RTX3060Ti
    Sound Card
    Onboard; Realtek
    Monitor(s) Displays
    34" LG 34UC79G-B Curved 21:9 144Hz
    Screen Resolution
    2560x1080 (No HDR)
    Hard Drives
    250Gb Samsung 870PRO NVMe (Win 11 Pro)
    1Tb Samsung 980PRO NVMe
    1Tb Samsung 970EVO NVMe
    2Tb Samsung 990PRO NVMe with heatsink.
    4Tb WDC WD40EZRZ Blue SATA (Int.)
    4Tb WDC WD40EZRZ Blue SATA (Int.)
    3Tb WDC WD30EFRZ Red SATA (Int.)
    256Gb Samsung 840PRO SSD (RHEL 9,5)
    256Gb Samsung 850PRO SSD (Zorin OS Pro 18)
    PSU
    Coolermaster 850W V2 Gold with internal 12cm exaust fan
    Case
    Be-Quiet Pure Base 600.
    Cooling
    3x Be-Quiet! 12/14cm "Silent Wings 4" casefans, 1x Arctic Freezer i35 CPU towerblock with fan.
    Keyboard
    Steelseries APEX 7 keyboard.
    Mouse
    Logitech G-502 Hero
    Internet Speed
    1Gb
    Browser
    Brave
    Antivirus
    F-Secure
    Other Info
    No Noise system.
    256Gb Kingston Travler USB 3.0 drive.
    64Gb Sandisk USB 3.2 drive. (Ventoy)
    8Gb Philips USB 3.0 drive. (Win. Inst.)
    8Gb Philips USB 3.0 drive. (Rescue disk)
    2Tb WD USB 3.0 Passport drive.
    USB Ext. 500Gb WD SATA drive.
    External USB 3.0 C.A. CD/DVD* burner.
Back
Top Bottom