DISM.exe Cleanup-Image


Kol12

Active member
Member
VIP
Local time
3:43 PM
Posts
264
OS
Windows 11 - Release Preview channel
Does anybody know what the Cleanup-Image switch in the DISM.exe/Online/Cleanup-Image/Restorehealth command actually does? If my image is already clean and I run the command will it perform some kind of cleanup?

 

My Computer

System One

  • OS
    Windows 11 - Release Preview channel
    Computer type
    PC/Desktop
    Manufacturer/Model
    Kol's custom ROG Z590
    CPU
    Intel 10900K @ 5.1 Ghz
    Motherboard
    Asus ROG Maximus XIII Hero Z590
    Memory
    Corsair Dominator Platinum RGB 32GB (4x8) OC to 3866Mhz CL 16
    Graphics Card(s)
    Asus ROG Strix 3080 OC edition
    Sound Card
    SoundBlaster X-AE5
    Monitor(s) Displays
    Asus ROG PG349Q 34" 120hz Gysnc
    Screen Resolution
    3440x1440
    Hard Drives
    Samsung 980 Pro 500GB
    860 EVO's
    Adata SX2000 Pro 1TB
    External RAID enclosure - Seagate 3TB HDD's
    PSU
    Seasonic Prime Ultra 1300W Platinum
    Case
    Phanteks Eclipse P600S
    Cooling
    Custom water cooling. EK Velocity (CPU), EK Quantum Vector (GPU), EK Quantum D5 Pump, 360 + 280 mm rads, 3x120mm Corsair LL, 3x 140mm Corsair LL fans
    Keyboard
    Corsair K70 MK.2 SE
    Mouse
    Corsair Dark Core Pro Wireless
    Antivirus
    Windows Defender

Ghot

Well-known member
Pro User
VIP
Local time
11:43 PM
Posts
3,118
Location
PA, USA
OS
Win 11 Home ♦♦♦22000.778
Cleanup-Image is more like the name of the DISM tool you are telling DISM to use.
It's sort of like using the command "Cleanmgr", or telling someone to use a hammer.

The switches after Cleanup-Image tell DISM how to use the Cleanup-Image tool.




 
Last edited:

My Computers

System One System Two

  • OS
    Win 11 Home ♦♦♦22000.778
    Computer type
    PC/Desktop
    Manufacturer/Model
    Built by Ghot® [May 2020]
    CPU
    AMD Ryzen 7 3700X
    Motherboard
    Asus Pro WS X570-ACE
    Memory
    G.Skill (F4-3200C14D-16GTZKW)
    Graphics Card(s)
    EVGA RTX 2070 (08G-P4-2171-KR)
    Sound Card
    (onboard) Realtek ALC1220P / ALC S1220A
    Monitor(s) Displays
    Dell U3011 30"
    Screen Resolution
    2560 x 1600
    Hard Drives
    2x Samsung 860 EVO 500GB,
    WD 4TB Black FZBX - SATA III,
    WD 8TB Black FZBX - SATA III,
    LG GH22LS30 CD/DVD Burner
    PSU
    PC Power & Cooling 750W Quad EPS12V
    Case
    COOLER MASTER ATCS 840 Full Tower
    Cooling
    CM Hyper 212 EVO (push/pull)
    Keyboard
    Ducky DK9008 Shine II Blue LED
    Mouse
    Logitech Optical M-100
    Internet Speed
    100/100
    Browser
    Firefox (latest)
    Antivirus
    Bitdefender Internet Security (latest)
    Other Info
    Speakers: Klipsch Pro Media 2.1
  • Operating System
    Windows XP Pro 32bit w/SP3
    Computer type
    PC/Desktop
    Manufacturer/Model
    Built by Ghot®
    CPU
    AMD Athlon 64 X2 5000+ (OC'd @ 3.2Ghz)
    Motherboard
    ASUS M2N32-SLI Deluxe Wireless Edition
    Memory
    TWIN2X2048-6400C4DHX (2 x 1GB, DDR2 800)
    Graphics card(s)
    EVGA 256-P2-N758-TR GeForce 8600GT SSC
    Sound Card
    Onboard
    Monitor(s) Displays
    ViewSonic G90FB Black 19" Professional (CRT)
    Screen Resolution
    up to 2048 x 1536
    Hard Drives
    WD 36GB 10,000rpm Raptor SATA
    Seagate 80GB 7200rpm SATA
    Lite-On LTR-52246S CD/RW
    Lite-On LH-18A1P CD/DVD Burner
    PSU
    PC Power & Cooling Silencer 750 Quad EPS12V
    Case
    Generic Beige case, 80mm fans
    Cooling
    ZALMAN 9500A 92mm CPU Cooler
    Mouse
    Logitech Optical M-BT96a
    Keyboard
    Logitech Classic Keybooard 200
    Internet Speed
    100/100
    Browser
    Firefox 3.x ??
    Antivirus
    Symantec (Norton)
    Other Info
    Still assembled, still runs. Haven't turned it on for 13 years?

    http://www.xtremesystems.org/forums/showthread.php?183088-5000-B-E-on-M2N32-SLI-Dlx-Overclocked&p=2891724#post2891724

Bree

Well-known member
Pro User
VIP
Local time
4:43 AM
Posts
2,801
Location
S/E England, UK
OS
Windows 11 Home
Dism's /cleanup-image switch is used for all operations that analyse, clean up, or repair the WinSxS component store.

dism /online /cleanup-image /analyzecomponentstore reports the size of the component store, and whether any packages can be cleaned up.

dism /online /cleanup-image /startcomponentcleanup removes old packages that are no longer necessary.

The /RestoreHealth option checks for corrupt files in the WinSxS component store. If any files are corrupt, then a replacement copy is downloaded from Microsoft.

It is normally only needed if SFC /ScanNow reports that it has found errors that it cannot correct. The usuall reason it cannot do so is that the replacement from the component store is also corrupt.
 

My Computers

System One System Two

  • OS
    Windows 11 Home
    Computer type
    Laptop
    Manufacturer/Model
    Acer Aspire 3 A315-23
    CPU
    AMD Athlon Silver 3050U
    Memory
    8GB
    Graphics Card(s)
    Radeon Graphics
    Monitor(s) Displays
    laptop screen
    Screen Resolution
    1366x768 native resolution, up to 2560x1440 with Radeon Virtual Super Resolution
    Hard Drives
    1TB HDD
    Browser
    Edge, Firefox
    Antivirus
    Defender
    Other Info
    fully 'Windows 11 ready' laptop. Windows 10 C: partition migrated from my old unsupported 'main machine' then upgraded to 11. A test migration ran Insider builds for 2 months. When 11 was released on 5th October it was re-imaged back to 10 and was offered the upgrade in Windows Update on 20th October.


    My SYSTEM THREE is a Dell Latitude 5410, i7-10610U, 32GB RAM, 512GB ssd, Windows 11 Pro.
  • Operating System
    Windows 11 Pro
    Computer type
    Laptop
    Manufacturer/Model
    Dell Lattitude E4310
    CPU
    i5 M 520
    Motherboard
    0T6M8G
    Memory
    4GB
    Screen Resolution
    1366x768
    Hard Drives
    500GB HDD
    Browser
    Firefox, Edge
    Antivirus
    Defender
    Other Info
    unsupported machine: Legacy bios, MBR, TPM 1.2, upgraded from W10 to W11 using W10/W11 hybrid install media workaround.


    My SYSTEM THREE is a Dell Latitude 5410, i7-10610U, 32GB RAM, 512GB ssd, Windows 11 Pro.

iko22

Well-known member
Member
VIP
Local time
4:43 AM
Posts
557
Location
South West England
OS
Windows 10
If my image is already clean and I run the command will it perform some kind of cleanup?

In the DISM session, there is a call to C:\WINDOWS\system32\cleanmgr.exe /autoclean /d C: - DismInitializeInternal
The /Autoclean switch examines the system files left over from a previous Windows version/in-place upgrade and also remove those files automatically.
- DismInitializeInternal appears to be an undocumented switch, as I cannot find anything on about it.
 

My Computer

System One

  • OS
    Windows 10
    CPU
    TBA
    Motherboard
    TBA

Kol12

Active member
Member
VIP
Thread Starter
Local time
3:43 PM
Posts
264
OS
Windows 11 - Release Preview channel
Dism's /cleanup-image switch is used for all operations that analyse, clean up, or repair the WinSxS component store.

dism /online /cleanup-image /analyzecomponentstore reports the size of the component store, and whether any packages can be cleaned up.

dism /online /cleanup-image /startcomponentcleanup removes old packages that are no longer necessary.

The /RestoreHealth option checks for corrupt files in the WinSxS component store. If any files are corrupt, then a replacement copy is downloaded from Microsoft.

It is normally only needed if SFC /ScanNow reports that it has found errors that it cannot correct. The usuall reason it cannot do so is that the replacement from the component store is also corrupt.
Would the two DISM commands you mention be good ones to run as part of regular maintenance?
 

My Computer

System One

  • OS
    Windows 11 - Release Preview channel
    Computer type
    PC/Desktop
    Manufacturer/Model
    Kol's custom ROG Z590
    CPU
    Intel 10900K @ 5.1 Ghz
    Motherboard
    Asus ROG Maximus XIII Hero Z590
    Memory
    Corsair Dominator Platinum RGB 32GB (4x8) OC to 3866Mhz CL 16
    Graphics Card(s)
    Asus ROG Strix 3080 OC edition
    Sound Card
    SoundBlaster X-AE5
    Monitor(s) Displays
    Asus ROG PG349Q 34" 120hz Gysnc
    Screen Resolution
    3440x1440
    Hard Drives
    Samsung 980 Pro 500GB
    860 EVO's
    Adata SX2000 Pro 1TB
    External RAID enclosure - Seagate 3TB HDD's
    PSU
    Seasonic Prime Ultra 1300W Platinum
    Case
    Phanteks Eclipse P600S
    Cooling
    Custom water cooling. EK Velocity (CPU), EK Quantum Vector (GPU), EK Quantum D5 Pump, 360 + 280 mm rads, 3x120mm Corsair LL, 3x 140mm Corsair LL fans
    Keyboard
    Corsair K70 MK.2 SE
    Mouse
    Corsair Dark Core Pro Wireless
    Antivirus
    Windows Defender

Ghot

Well-known member
Pro User
VIP
Local time
11:43 PM
Posts
3,118
Location
PA, USA
OS
Win 11 Home ♦♦♦22000.778
I run this one after every Windows Update. It cleans all but the last folder, from the C:\Windows\servicing\LCU folder...

Dism.exe /online /Cleanup-Image /StartComponentCleanup
 

My Computers

System One System Two

  • OS
    Win 11 Home ♦♦♦22000.778
    Computer type
    PC/Desktop
    Manufacturer/Model
    Built by Ghot® [May 2020]
    CPU
    AMD Ryzen 7 3700X
    Motherboard
    Asus Pro WS X570-ACE
    Memory
    G.Skill (F4-3200C14D-16GTZKW)
    Graphics Card(s)
    EVGA RTX 2070 (08G-P4-2171-KR)
    Sound Card
    (onboard) Realtek ALC1220P / ALC S1220A
    Monitor(s) Displays
    Dell U3011 30"
    Screen Resolution
    2560 x 1600
    Hard Drives
    2x Samsung 860 EVO 500GB,
    WD 4TB Black FZBX - SATA III,
    WD 8TB Black FZBX - SATA III,
    LG GH22LS30 CD/DVD Burner
    PSU
    PC Power & Cooling 750W Quad EPS12V
    Case
    COOLER MASTER ATCS 840 Full Tower
    Cooling
    CM Hyper 212 EVO (push/pull)
    Keyboard
    Ducky DK9008 Shine II Blue LED
    Mouse
    Logitech Optical M-100
    Internet Speed
    100/100
    Browser
    Firefox (latest)
    Antivirus
    Bitdefender Internet Security (latest)
    Other Info
    Speakers: Klipsch Pro Media 2.1
  • Operating System
    Windows XP Pro 32bit w/SP3
    Computer type
    PC/Desktop
    Manufacturer/Model
    Built by Ghot®
    CPU
    AMD Athlon 64 X2 5000+ (OC'd @ 3.2Ghz)
    Motherboard
    ASUS M2N32-SLI Deluxe Wireless Edition
    Memory
    TWIN2X2048-6400C4DHX (2 x 1GB, DDR2 800)
    Graphics card(s)
    EVGA 256-P2-N758-TR GeForce 8600GT SSC
    Sound Card
    Onboard
    Monitor(s) Displays
    ViewSonic G90FB Black 19" Professional (CRT)
    Screen Resolution
    up to 2048 x 1536
    Hard Drives
    WD 36GB 10,000rpm Raptor SATA
    Seagate 80GB 7200rpm SATA
    Lite-On LTR-52246S CD/RW
    Lite-On LH-18A1P CD/DVD Burner
    PSU
    PC Power & Cooling Silencer 750 Quad EPS12V
    Case
    Generic Beige case, 80mm fans
    Cooling
    ZALMAN 9500A 92mm CPU Cooler
    Mouse
    Logitech Optical M-BT96a
    Keyboard
    Logitech Classic Keybooard 200
    Internet Speed
    100/100
    Browser
    Firefox 3.x ??
    Antivirus
    Symantec (Norton)
    Other Info
    Still assembled, still runs. Haven't turned it on for 13 years?

    http://www.xtremesystems.org/forums/showthread.php?183088-5000-B-E-on-M2N32-SLI-Dlx-Overclocked&p=2891724#post2891724

Kol12

Active member
Member
VIP
Thread Starter
Local time
3:43 PM
Posts
264
OS
Windows 11 - Release Preview channel
I run this one after every Windows Update. It cleans all but the last folder, from the C:\Windows\servicing\LCU folder...

Dism.exe /online /Cleanup-Image /StartComponentCleanup
Would that affect uninstalling any updates? I know the disk cleanup utility warns about not being able to uninstall updates if you clean Windows Update files...
 

My Computer

System One

  • OS
    Windows 11 - Release Preview channel
    Computer type
    PC/Desktop
    Manufacturer/Model
    Kol's custom ROG Z590
    CPU
    Intel 10900K @ 5.1 Ghz
    Motherboard
    Asus ROG Maximus XIII Hero Z590
    Memory
    Corsair Dominator Platinum RGB 32GB (4x8) OC to 3866Mhz CL 16
    Graphics Card(s)
    Asus ROG Strix 3080 OC edition
    Sound Card
    SoundBlaster X-AE5
    Monitor(s) Displays
    Asus ROG PG349Q 34" 120hz Gysnc
    Screen Resolution
    3440x1440
    Hard Drives
    Samsung 980 Pro 500GB
    860 EVO's
    Adata SX2000 Pro 1TB
    External RAID enclosure - Seagate 3TB HDD's
    PSU
    Seasonic Prime Ultra 1300W Platinum
    Case
    Phanteks Eclipse P600S
    Cooling
    Custom water cooling. EK Velocity (CPU), EK Quantum Vector (GPU), EK Quantum D5 Pump, 360 + 280 mm rads, 3x120mm Corsair LL, 3x 140mm Corsair LL fans
    Keyboard
    Corsair K70 MK.2 SE
    Mouse
    Corsair Dark Core Pro Wireless
    Antivirus
    Windows Defender

Ghot

Well-known member
Pro User
VIP
Local time
11:43 PM
Posts
3,118
Location
PA, USA
OS
Win 11 Home ♦♦♦22000.778
Would that affect uninstalling any updates? I know the disk cleanup utility warns about not being able to uninstall updates if you clean Windows Update files...


I make a fresh Macrium Reflect backup right before I update.
Even "with" the folders in LCU.... Microsoft could slip in a non-removable update.

The way I look at it... NOT having a fresh backup would be like going along with
the kid on the street who says: "Gimme your wallet, and I'll show you a trick". :D
 

My Computers

System One System Two

  • OS
    Win 11 Home ♦♦♦22000.778
    Computer type
    PC/Desktop
    Manufacturer/Model
    Built by Ghot® [May 2020]
    CPU
    AMD Ryzen 7 3700X
    Motherboard
    Asus Pro WS X570-ACE
    Memory
    G.Skill (F4-3200C14D-16GTZKW)
    Graphics Card(s)
    EVGA RTX 2070 (08G-P4-2171-KR)
    Sound Card
    (onboard) Realtek ALC1220P / ALC S1220A
    Monitor(s) Displays
    Dell U3011 30"
    Screen Resolution
    2560 x 1600
    Hard Drives
    2x Samsung 860 EVO 500GB,
    WD 4TB Black FZBX - SATA III,
    WD 8TB Black FZBX - SATA III,
    LG GH22LS30 CD/DVD Burner
    PSU
    PC Power & Cooling 750W Quad EPS12V
    Case
    COOLER MASTER ATCS 840 Full Tower
    Cooling
    CM Hyper 212 EVO (push/pull)
    Keyboard
    Ducky DK9008 Shine II Blue LED
    Mouse
    Logitech Optical M-100
    Internet Speed
    100/100
    Browser
    Firefox (latest)
    Antivirus
    Bitdefender Internet Security (latest)
    Other Info
    Speakers: Klipsch Pro Media 2.1
  • Operating System
    Windows XP Pro 32bit w/SP3
    Computer type
    PC/Desktop
    Manufacturer/Model
    Built by Ghot®
    CPU
    AMD Athlon 64 X2 5000+ (OC'd @ 3.2Ghz)
    Motherboard
    ASUS M2N32-SLI Deluxe Wireless Edition
    Memory
    TWIN2X2048-6400C4DHX (2 x 1GB, DDR2 800)
    Graphics card(s)
    EVGA 256-P2-N758-TR GeForce 8600GT SSC
    Sound Card
    Onboard
    Monitor(s) Displays
    ViewSonic G90FB Black 19" Professional (CRT)
    Screen Resolution
    up to 2048 x 1536
    Hard Drives
    WD 36GB 10,000rpm Raptor SATA
    Seagate 80GB 7200rpm SATA
    Lite-On LTR-52246S CD/RW
    Lite-On LH-18A1P CD/DVD Burner
    PSU
    PC Power & Cooling Silencer 750 Quad EPS12V
    Case
    Generic Beige case, 80mm fans
    Cooling
    ZALMAN 9500A 92mm CPU Cooler
    Mouse
    Logitech Optical M-BT96a
    Keyboard
    Logitech Classic Keybooard 200
    Internet Speed
    100/100
    Browser
    Firefox 3.x ??
    Antivirus
    Symantec (Norton)
    Other Info
    Still assembled, still runs. Haven't turned it on for 13 years?

    http://www.xtremesystems.org/forums/showthread.php?183088-5000-B-E-on-M2N32-SLI-Dlx-Overclocked&p=2891724#post2891724

Kol12

Active member
Member
VIP
Thread Starter
Local time
3:43 PM
Posts
264
OS
Windows 11 - Release Preview channel
I make a fresh Macrium Reflect backup right before I update.
Even "with" the folders in LCU.... Microsoft could slip in a non-removable update.

The way I look at it... NOT having a fresh backup would be like going along with
the kid on the street who says: "Gimme your wallet, and I'll show you a trick". :D
What is the benefit to running Dism.exe /online /Cleanup-Image /StartComponentCleanup after each Windows update?
 

My Computer

System One

  • OS
    Windows 11 - Release Preview channel
    Computer type
    PC/Desktop
    Manufacturer/Model
    Kol's custom ROG Z590
    CPU
    Intel 10900K @ 5.1 Ghz
    Motherboard
    Asus ROG Maximus XIII Hero Z590
    Memory
    Corsair Dominator Platinum RGB 32GB (4x8) OC to 3866Mhz CL 16
    Graphics Card(s)
    Asus ROG Strix 3080 OC edition
    Sound Card
    SoundBlaster X-AE5
    Monitor(s) Displays
    Asus ROG PG349Q 34" 120hz Gysnc
    Screen Resolution
    3440x1440
    Hard Drives
    Samsung 980 Pro 500GB
    860 EVO's
    Adata SX2000 Pro 1TB
    External RAID enclosure - Seagate 3TB HDD's
    PSU
    Seasonic Prime Ultra 1300W Platinum
    Case
    Phanteks Eclipse P600S
    Cooling
    Custom water cooling. EK Velocity (CPU), EK Quantum Vector (GPU), EK Quantum D5 Pump, 360 + 280 mm rads, 3x120mm Corsair LL, 3x 140mm Corsair LL fans
    Keyboard
    Corsair K70 MK.2 SE
    Mouse
    Corsair Dark Core Pro Wireless
    Antivirus
    Windows Defender

Kol12

Active member
Member
VIP
Thread Starter
Local time
3:43 PM
Posts
264
OS
Windows 11 - Release Preview channel
@Bree What are old/reclaimable packages?

StartComponentCleanup is supposed to run automatically as a scheduled task in Task Scheduler: Clean Up the WinSxS Folder

So what advantage is there to running the command manually? Analyze Component Store says I have 4 reclaimable packages:

DISM AnalyzeComponentStore.png
 

My Computer

System One

  • OS
    Windows 11 - Release Preview channel
    Computer type
    PC/Desktop
    Manufacturer/Model
    Kol's custom ROG Z590
    CPU
    Intel 10900K @ 5.1 Ghz
    Motherboard
    Asus ROG Maximus XIII Hero Z590
    Memory
    Corsair Dominator Platinum RGB 32GB (4x8) OC to 3866Mhz CL 16
    Graphics Card(s)
    Asus ROG Strix 3080 OC edition
    Sound Card
    SoundBlaster X-AE5
    Monitor(s) Displays
    Asus ROG PG349Q 34" 120hz Gysnc
    Screen Resolution
    3440x1440
    Hard Drives
    Samsung 980 Pro 500GB
    860 EVO's
    Adata SX2000 Pro 1TB
    External RAID enclosure - Seagate 3TB HDD's
    PSU
    Seasonic Prime Ultra 1300W Platinum
    Case
    Phanteks Eclipse P600S
    Cooling
    Custom water cooling. EK Velocity (CPU), EK Quantum Vector (GPU), EK Quantum D5 Pump, 360 + 280 mm rads, 3x120mm Corsair LL, 3x 140mm Corsair LL fans
    Keyboard
    Corsair K70 MK.2 SE
    Mouse
    Corsair Dark Core Pro Wireless
    Antivirus
    Windows Defender

Bree

Well-known member
Pro User
VIP
Local time
4:43 AM
Posts
2,801
Location
S/E England, UK
OS
Windows 11 Home
Would the two DISM commands you mention be good ones to run as part of regular maintenance?
.....
Would that affect uninstalling any updates? I know the disk cleanup utility warns about not being able to uninstall updates if you clean Windows Update files...
I routinely run Disk Clean up to clean up system files after every cumulative update. If the list of things it finds to clean up includes 'Windows update clean-up' then it will run the same task as 2nd DISM command. It's just another way of starting exactly the same process. So yes, the same warnings apply. You will still be able to uninstall the latest cumulative update though.

In fact, when Disk Clean up is checking to see if Windows updates need to be cleaned up it is running the same task as the first of my two commands, and appears to only offer to clean up if that returns a 'clean up recommend: yes' result. If Disk Clean up decides there is no need to clean up updates then I'll run the DISM command myself, it usually finds there's a little that can be cleaned even if a clean up is not strictly needed at this time.
 

My Computers

System One System Two

  • OS
    Windows 11 Home
    Computer type
    Laptop
    Manufacturer/Model
    Acer Aspire 3 A315-23
    CPU
    AMD Athlon Silver 3050U
    Memory
    8GB
    Graphics Card(s)
    Radeon Graphics
    Monitor(s) Displays
    laptop screen
    Screen Resolution
    1366x768 native resolution, up to 2560x1440 with Radeon Virtual Super Resolution
    Hard Drives
    1TB HDD
    Browser
    Edge, Firefox
    Antivirus
    Defender
    Other Info
    fully 'Windows 11 ready' laptop. Windows 10 C: partition migrated from my old unsupported 'main machine' then upgraded to 11. A test migration ran Insider builds for 2 months. When 11 was released on 5th October it was re-imaged back to 10 and was offered the upgrade in Windows Update on 20th October.


    My SYSTEM THREE is a Dell Latitude 5410, i7-10610U, 32GB RAM, 512GB ssd, Windows 11 Pro.
  • Operating System
    Windows 11 Pro
    Computer type
    Laptop
    Manufacturer/Model
    Dell Lattitude E4310
    CPU
    i5 M 520
    Motherboard
    0T6M8G
    Memory
    4GB
    Screen Resolution
    1366x768
    Hard Drives
    500GB HDD
    Browser
    Firefox, Edge
    Antivirus
    Defender
    Other Info
    unsupported machine: Legacy bios, MBR, TPM 1.2, upgraded from W10 to W11 using W10/W11 hybrid install media workaround.


    My SYSTEM THREE is a Dell Latitude 5410, i7-10610U, 32GB RAM, 512GB ssd, Windows 11 Pro.

Bree

Well-known member
Pro User
VIP
Local time
4:43 AM
Posts
2,801
Location
S/E England, UK
OS
Windows 11 Home
What is the benefit to running Dism.exe /online /Cleanup-Image /StartComponentCleanup after each Windows update?
If you also routinely make system images with Macrium Reflect or similar, then it will be a smaller image if you clean up before making it. There can be a GB or so of updates that can be cleaned up.
 

My Computers

System One System Two

  • OS
    Windows 11 Home
    Computer type
    Laptop
    Manufacturer/Model
    Acer Aspire 3 A315-23
    CPU
    AMD Athlon Silver 3050U
    Memory
    8GB
    Graphics Card(s)
    Radeon Graphics
    Monitor(s) Displays
    laptop screen
    Screen Resolution
    1366x768 native resolution, up to 2560x1440 with Radeon Virtual Super Resolution
    Hard Drives
    1TB HDD
    Browser
    Edge, Firefox
    Antivirus
    Defender
    Other Info
    fully 'Windows 11 ready' laptop. Windows 10 C: partition migrated from my old unsupported 'main machine' then upgraded to 11. A test migration ran Insider builds for 2 months. When 11 was released on 5th October it was re-imaged back to 10 and was offered the upgrade in Windows Update on 20th October.


    My SYSTEM THREE is a Dell Latitude 5410, i7-10610U, 32GB RAM, 512GB ssd, Windows 11 Pro.
  • Operating System
    Windows 11 Pro
    Computer type
    Laptop
    Manufacturer/Model
    Dell Lattitude E4310
    CPU
    i5 M 520
    Motherboard
    0T6M8G
    Memory
    4GB
    Screen Resolution
    1366x768
    Hard Drives
    500GB HDD
    Browser
    Firefox, Edge
    Antivirus
    Defender
    Other Info
    unsupported machine: Legacy bios, MBR, TPM 1.2, upgraded from W10 to W11 using W10/W11 hybrid install media workaround.


    My SYSTEM THREE is a Dell Latitude 5410, i7-10610U, 32GB RAM, 512GB ssd, Windows 11 Pro.

Bree

Well-known member
Pro User
VIP
Local time
4:43 AM
Posts
2,801
Location
S/E England, UK
OS
Windows 11 Home
So what advantage is there to running the command manually? Analyze Component Store says I have 4 reclaimable packages
If you use Disk Clean up and click its 'clean up system files' button, then it too will say there are Windows updates to be cleaned up. If you let Disk Clean up clean them up then there's no advantage - it has already done the same job. If on the other hand it doesn't say there is any need to clean up updates, then I run it manually. There's usually a little that can be cleaned, even if Disk Clean up thinks it's not worth the bother.

Reclaimable packages are older updates that have subsequently been replaced themselves. There's no point in keeping them unless you think you'll want to go a long way back by uninstaling many of the more recent updates.
 

My Computers

System One System Two

  • OS
    Windows 11 Home
    Computer type
    Laptop
    Manufacturer/Model
    Acer Aspire 3 A315-23
    CPU
    AMD Athlon Silver 3050U
    Memory
    8GB
    Graphics Card(s)
    Radeon Graphics
    Monitor(s) Displays
    laptop screen
    Screen Resolution
    1366x768 native resolution, up to 2560x1440 with Radeon Virtual Super Resolution
    Hard Drives
    1TB HDD
    Browser
    Edge, Firefox
    Antivirus
    Defender
    Other Info
    fully 'Windows 11 ready' laptop. Windows 10 C: partition migrated from my old unsupported 'main machine' then upgraded to 11. A test migration ran Insider builds for 2 months. When 11 was released on 5th October it was re-imaged back to 10 and was offered the upgrade in Windows Update on 20th October.


    My SYSTEM THREE is a Dell Latitude 5410, i7-10610U, 32GB RAM, 512GB ssd, Windows 11 Pro.
  • Operating System
    Windows 11 Pro
    Computer type
    Laptop
    Manufacturer/Model
    Dell Lattitude E4310
    CPU
    i5 M 520
    Motherboard
    0T6M8G
    Memory
    4GB
    Screen Resolution
    1366x768
    Hard Drives
    500GB HDD
    Browser
    Firefox, Edge
    Antivirus
    Defender
    Other Info
    unsupported machine: Legacy bios, MBR, TPM 1.2, upgraded from W10 to W11 using W10/W11 hybrid install media workaround.


    My SYSTEM THREE is a Dell Latitude 5410, i7-10610U, 32GB RAM, 512GB ssd, Windows 11 Pro.

Kol12

Active member
Member
VIP
Thread Starter
Local time
3:43 PM
Posts
264
OS
Windows 11 - Release Preview channel
How many Windows updates will it let you uninstall after you've run Windows Update cleanup via Disk Cleanup? This is something that was never very clear to me.
 

My Computer

System One

  • OS
    Windows 11 - Release Preview channel
    Computer type
    PC/Desktop
    Manufacturer/Model
    Kol's custom ROG Z590
    CPU
    Intel 10900K @ 5.1 Ghz
    Motherboard
    Asus ROG Maximus XIII Hero Z590
    Memory
    Corsair Dominator Platinum RGB 32GB (4x8) OC to 3866Mhz CL 16
    Graphics Card(s)
    Asus ROG Strix 3080 OC edition
    Sound Card
    SoundBlaster X-AE5
    Monitor(s) Displays
    Asus ROG PG349Q 34" 120hz Gysnc
    Screen Resolution
    3440x1440
    Hard Drives
    Samsung 980 Pro 500GB
    860 EVO's
    Adata SX2000 Pro 1TB
    External RAID enclosure - Seagate 3TB HDD's
    PSU
    Seasonic Prime Ultra 1300W Platinum
    Case
    Phanteks Eclipse P600S
    Cooling
    Custom water cooling. EK Velocity (CPU), EK Quantum Vector (GPU), EK Quantum D5 Pump, 360 + 280 mm rads, 3x120mm Corsair LL, 3x 140mm Corsair LL fans
    Keyboard
    Corsair K70 MK.2 SE
    Mouse
    Corsair Dark Core Pro Wireless
    Antivirus
    Windows Defender

zbook

Well-known member
Power User
VIP
Local time
10:43 PM
Posts
1,067
OS
Windows 10
When disk drives were small it was necessary to analyze the component store and clean to enlarge drive free space.
If the computer has a large drive for Windows which has a lot of free space the analyze and clean commands may rarely need to run.

Restorehealth and scannow commands compare files to identify integrity violations, including corruption and errors.
To tune up computers the restorehealth and scannow commands are frequently run.

When troubleshooting computers running the restorehealth and scannow commands creates a baseline.

Uninstalling Windows updates is a trial and error step.
There are update dependencies, time periods, etc. that may impact uninstallation.
It's possible to know in advance that an attempted uninstall of an update will fail (reported / known dependencies).
It's not possible to know in advance whether the uninstallation of updates will work.
 

My Computer

System One

  • OS
    Windows 10
    Computer type
    Laptop
    Manufacturer/Model
    HP
    CPU
    Intel(R) Core(TM) i7-4800MQ CPU @ 2.70GHz
    Motherboard
    Product : 190A Version : KBC Version 94.56
    Memory
    16 GB Total: Manufacturer : Samsung MemoryType : DDR3 FormFactor : SODIMM Capacity : 8GB Speed : 1600
    Graphics Card(s)
    NVIDIA Quadro K3100M; Intel(R) HD Graphics 4600
    Sound Card
    IDT High Definition Audio CODEC; PNP Device ID HDAUDIO\FUNC_01&VEN_111D&DEV_76E0
    Hard Drives
    Model Hitachi HTS727575A9E364
    Antivirus
    Microsoft Defender
    Other Info
    Mobile Workstation

Kol12

Active member
Member
VIP
Thread Starter
Local time
3:43 PM
Posts
264
OS
Windows 11 - Release Preview channel
@zbook Do I need to run DISM /Online /Cleanup-Image /RestoreHealth if DISM /Online /Cleanup-Image /ScanHealth is OK?
 

My Computer

System One

  • OS
    Windows 11 - Release Preview channel
    Computer type
    PC/Desktop
    Manufacturer/Model
    Kol's custom ROG Z590
    CPU
    Intel 10900K @ 5.1 Ghz
    Motherboard
    Asus ROG Maximus XIII Hero Z590
    Memory
    Corsair Dominator Platinum RGB 32GB (4x8) OC to 3866Mhz CL 16
    Graphics Card(s)
    Asus ROG Strix 3080 OC edition
    Sound Card
    SoundBlaster X-AE5
    Monitor(s) Displays
    Asus ROG PG349Q 34" 120hz Gysnc
    Screen Resolution
    3440x1440
    Hard Drives
    Samsung 980 Pro 500GB
    860 EVO's
    Adata SX2000 Pro 1TB
    External RAID enclosure - Seagate 3TB HDD's
    PSU
    Seasonic Prime Ultra 1300W Platinum
    Case
    Phanteks Eclipse P600S
    Cooling
    Custom water cooling. EK Velocity (CPU), EK Quantum Vector (GPU), EK Quantum D5 Pump, 360 + 280 mm rads, 3x120mm Corsair LL, 3x 140mm Corsair LL fans
    Keyboard
    Corsair K70 MK.2 SE
    Mouse
    Corsair Dark Core Pro Wireless
    Antivirus
    Windows Defender

zbook

Well-known member
Power User
VIP
Local time
10:43 PM
Posts
1,067
OS
Windows 10
The scanhealth command is run to identify reported corruption.
The restorehealth command is run to repair corruptions.

Scanhealth may find no corruption.
Restorehealth may display an error code.

If restorehealth displays an error code it provides information that the restorehealth command may not be available when it is needed.

So it's best to run the restorehealth command instead of the scanhealth command.

Running the scanhealth command in addition to the restorehealth command may be useful when troubleshooting as it may create an additional error code.
 

My Computer

System One

  • OS
    Windows 10
    Computer type
    Laptop
    Manufacturer/Model
    HP
    CPU
    Intel(R) Core(TM) i7-4800MQ CPU @ 2.70GHz
    Motherboard
    Product : 190A Version : KBC Version 94.56
    Memory
    16 GB Total: Manufacturer : Samsung MemoryType : DDR3 FormFactor : SODIMM Capacity : 8GB Speed : 1600
    Graphics Card(s)
    NVIDIA Quadro K3100M; Intel(R) HD Graphics 4600
    Sound Card
    IDT High Definition Audio CODEC; PNP Device ID HDAUDIO\FUNC_01&VEN_111D&DEV_76E0
    Hard Drives
    Model Hitachi HTS727575A9E364
    Antivirus
    Microsoft Defender
    Other Info
    Mobile Workstation

Kol12

Active member
Member
VIP
Thread Starter
Local time
3:43 PM
Posts
264
OS
Windows 11 - Release Preview channel
So it's best to run the restorehealth command instead of the scanhealth command.
I'm not sure I understand why you say this. Do you mean restorehealth will pick up on things scanhealth may not?
If restorehealth displays an error code it provides information that the restorehealth command may not be available when it is needed.
What does this mean?
 
Last edited:

My Computer

System One

  • OS
    Windows 11 - Release Preview channel
    Computer type
    PC/Desktop
    Manufacturer/Model
    Kol's custom ROG Z590
    CPU
    Intel 10900K @ 5.1 Ghz
    Motherboard
    Asus ROG Maximus XIII Hero Z590
    Memory
    Corsair Dominator Platinum RGB 32GB (4x8) OC to 3866Mhz CL 16
    Graphics Card(s)
    Asus ROG Strix 3080 OC edition
    Sound Card
    SoundBlaster X-AE5
    Monitor(s) Displays
    Asus ROG PG349Q 34" 120hz Gysnc
    Screen Resolution
    3440x1440
    Hard Drives
    Samsung 980 Pro 500GB
    860 EVO's
    Adata SX2000 Pro 1TB
    External RAID enclosure - Seagate 3TB HDD's
    PSU
    Seasonic Prime Ultra 1300W Platinum
    Case
    Phanteks Eclipse P600S
    Cooling
    Custom water cooling. EK Velocity (CPU), EK Quantum Vector (GPU), EK Quantum D5 Pump, 360 + 280 mm rads, 3x120mm Corsair LL, 3x 140mm Corsair LL fans
    Keyboard
    Corsair K70 MK.2 SE
    Mouse
    Corsair Dark Core Pro Wireless
    Antivirus
    Windows Defender

zbook

Well-known member
Power User
VIP
Local time
10:43 PM
Posts
1,067
OS
Windows 10
For the Windows component store:
a) scanhealth is used to find reported corruption
b) restorehealth is used to find and repair corruption

If scannow finds corruption that it cannot repair it often can be fixed by a non-corrupt component store.

Restorehealth is run followed by scannow to fix the scannow corruption that scannow was not able to fix.


The restorehealth command that is typically run depends upon Windows update.
At times restorehealth will fail until it's error code is fixed.
When restorehealth fails it cannot fix scannow corruption that was not able to be fixed in the earlier comments.

So always running the restorehealth command instead of the scanhealth command is an extra preventative maintenance step.
 

My Computer

System One

  • OS
    Windows 10
    Computer type
    Laptop
    Manufacturer/Model
    HP
    CPU
    Intel(R) Core(TM) i7-4800MQ CPU @ 2.70GHz
    Motherboard
    Product : 190A Version : KBC Version 94.56
    Memory
    16 GB Total: Manufacturer : Samsung MemoryType : DDR3 FormFactor : SODIMM Capacity : 8GB Speed : 1600
    Graphics Card(s)
    NVIDIA Quadro K3100M; Intel(R) HD Graphics 4600
    Sound Card
    IDT High Definition Audio CODEC; PNP Device ID HDAUDIO\FUNC_01&VEN_111D&DEV_76E0
    Hard Drives
    Model Hitachi HTS727575A9E364
    Antivirus
    Microsoft Defender
    Other Info
    Mobile Workstation

Kol12

Active member
Member
VIP
Thread Starter
Local time
3:43 PM
Posts
264
OS
Windows 11 - Release Preview channel
If StartComponentCleanup is supposed to run automatically as a Task Scheduled task is it unusual dism /online /cleanup-image /analyzecomponentstore says I have 4 reclaimable packages and that Component Store Cleanup is recommended?
 

Attachments

  • DISM AnalyzeComponentStore.png
    DISM AnalyzeComponentStore.png
    13.8 KB · Views: 1

My Computer

System One

  • OS
    Windows 11 - Release Preview channel
    Computer type
    PC/Desktop
    Manufacturer/Model
    Kol's custom ROG Z590
    CPU
    Intel 10900K @ 5.1 Ghz
    Motherboard
    Asus ROG Maximus XIII Hero Z590
    Memory
    Corsair Dominator Platinum RGB 32GB (4x8) OC to 3866Mhz CL 16
    Graphics Card(s)
    Asus ROG Strix 3080 OC edition
    Sound Card
    SoundBlaster X-AE5
    Monitor(s) Displays
    Asus ROG PG349Q 34" 120hz Gysnc
    Screen Resolution
    3440x1440
    Hard Drives
    Samsung 980 Pro 500GB
    860 EVO's
    Adata SX2000 Pro 1TB
    External RAID enclosure - Seagate 3TB HDD's
    PSU
    Seasonic Prime Ultra 1300W Platinum
    Case
    Phanteks Eclipse P600S
    Cooling
    Custom water cooling. EK Velocity (CPU), EK Quantum Vector (GPU), EK Quantum D5 Pump, 360 + 280 mm rads, 3x120mm Corsair LL, 3x 140mm Corsair LL fans
    Keyboard
    Corsair K70 MK.2 SE
    Mouse
    Corsair Dark Core Pro Wireless
    Antivirus
    Windows Defender
Top Bottom