Run Disk Cleanup first, then use DISM only if Windows still shows a large WinSxS/component store, failed update cleanup, or low free space after reboot. If the component store is healthy, stop there. Skipping the right order can leave junk behind or remove files you still need. This guide shows the safe two-step workflow and the decision rule for when deeper cleanup is needed.
When Disk Cleanup is enough
Disk Cleanup is the right first pass when the problem is ordinary temporary files, Windows Update leftovers, delivery optimization cache, or other removable junk outside the component store. On Windows 10 and Windows 11, it can free a useful amount of space without touching the servicing stack. If free space returns to normal after that, DISM cleanup is usually unnecessary.
The key limit is simple: Disk Cleanup does not fully service the Windows component store, also called WinSxS. That store holds servicing files and source files, and it can keep superseded components that only DISM maintenance targets. If Disk Cleanup already ran and the system still feels cramped, the next question is whether WinSxS health needs work or whether another folder is the real space hog. (Microsoft)
Dism alongside disk cleanup decision table
| Symptom | Best next action | Expected outcome |
|---|---|---|
| Disk Cleanup already ran but space remains low | Open an elevated Terminal or Command Prompt and run Dism /Online /Cleanup-Image /StartComponentCleanup. If the store may be unhealthy, follow with Dism /Online /Cleanup-Image /CheckHealth, then /ScanHealth if needed. |
Superseded component store files may shrink. Pass check: available space improves and /CheckHealth reports no repair needed. |
| Windows Update Cleanup is stuck | Run Dism /Online /Cleanup-Image /StartComponentCleanup first. If cleanup still stalls or Windows reports corruption, add /CheckHealth, then /ScanHealth, then /RestoreHealth. |
Cleanup should finish or reveal whether the component store needs repair. Pass check: the command completes without error and servicing works again. |
| Component store health is questionable | Use Dism /Online /Cleanup-Image /CheckHealth first, then /ScanHealth if you need a deeper check. Use /RestoreHealth only when repair is actually needed. |
You get a fast health screen first, then a full scan if needed. Pass check: the store reports healthy, or repair completes cleanly. |
| DISM reports source corruption | Point DISM at a known-good source such as install.wim from Windows installation media and rerun /RestoreHealth with /Source and /LimitAccess if appropriate. | DISM can repair the component store from an alternate source instead of the damaged local one. Pass check: repair finishes without a source error. |
| User only wants safe cleanup without image repair | Run Dism /Online /Cleanup-Image /StartComponentCleanup and stop if the store is healthy. Do not move straight to repair commands unless health checks show a problem. |
Superseded components may be removed without repairing the image. Pass check: cleanup completes and no corruption is reported. |
Say your laptop still shows only 4 GB free after Disk Cleanup, but /CheckHealth reports no corruption. That points to ordinary component store cleanup, not repair. The right move is /StartComponentCleanup, not a full image repair sequence.
Suppose Windows Update Cleanup appears stuck on “cleaning up” after a reboot. That is a good time to inspect component store health, because the issue may be servicing churn rather than a separate temporary-file problem. If health checks pass, cleanup is enough; if they fail, move to repair.
How does DISM fit after Disk Cleanup?
DISM fits as the deeper maintenance tool after Disk Cleanup has removed the easy space wins. On Windows 10 and Windows 11, DISM is built in and runs from an elevated terminal. Its cleanup command trims the component store, while its health commands check whether the image needs repair before you run SFC.
The usual sequence is simple: use /CheckHealth first, then /ScanHealth if you need a deeper scan, then /RestoreHealth only when the store needs repair. That order matters because it starts with the quickest check and moves to the slowest, most invasive maintenance only when the evidence supports it.
- Check component store health.Run
Dism /Online /Cleanup-Image /CheckHealthin an elevated Command Prompt or Terminal. This is the fast screen for whether Windows already knows the component store is damaged. - Scan more deeply if needed.If /CheckHealth suggests possible damage or you want a fuller look, run
Dism /Online /Cleanup-Image /ScanHealth.This takes longer because it checks the component store in more detail. - Repair the store when needed.Run
Dism /Online /Cleanup-Image /RestoreHealthonly after a bad health result or a failed update cleanup that points to servicing trouble. This command repairs the Windows component store using a healthy source. - Follow with SFC.After DISM finishes, run
sfc /scannowso System File Checker can replace missing or corrupted system files using the repaired image as its source.
The distinction is practical. /StartComponentCleanup is for removing superseded component store files. /CheckHealth, /ScanHealth, and /RestoreHealth are for determining whether the image is healthy and fixing it if it is not. Do not use repair commands just because space is low.
Run DISM from an elevated terminal
Administrator privileges are generally required before you run DISM or SFC commands that change protected system files. Open Command Prompt or Terminal as administrator, then run the command family that matches the job: cleanup first, health checks next, repair only if needed. Without elevation, the command may fail or return access errors.
- Open an elevated shell.Right-click Start, choose Terminal or Command Prompt, and select the administrator option. You need that privilege before any cleanup or repair command can change the Windows image.
- Run the cleanup command.Enter
Dism /Online /Cleanup-Image /StartComponentCleanupif your goal is safe component store cleanup. This is the command that removes superseded components from the live Windows installation.(Microsoft Learn) - Check health before repair.If the system still looks unhealthy, run
Dism /Online /Cleanup-Image /CheckHealthfirst, then /ScanHealth if the quick check is not enough. That lets you decide whether /RestoreHealth is actually needed.
Do not assume DISM must always come before Disk Cleanup. The order is mostly about efficiency when free space is tight. If the disk has plenty of room, Disk Cleanup can run first or later. If space is critically low, start there because it may buy enough room for DISM to finish safely.
When should you use install.wim?
Use install.wim when DISM cannot repair the component store from the local source because that source is damaged or incomplete. Windows installation media often contains the alternate image DISM needs. This matters when /RestoreHealth fails with source-related errors or when local recovery content is broken.
DISM can repair Windows images for Windows Recovery Environment, Windows Setup, and Windows PE as well as the installed system. That is why alternate source handling matters in offline repair scenarios too. If the built-in source cannot help, a mounted installation image may supply the known-good files instead.
- Mount installation media.Use Windows installation media that contains install.wim. If the media has a different image format or edition, confirm the right source file for your model and version before you point DISM at it.
- Run RestoreHealth with source.Use
Dism /Online /Cleanup-Image /RestoreHealth /Source:wim:X:\sources\install.wim:1 /LimitAccess,replacing X: with the mounted media drive. The /LimitAccess switch keeps DISM from trying other online repair sources. - Rerun SFC after repair.Finish with
sfc /scannowso Windows can verify files against the repaired image. If SFC still reports unfixable damage, the source image may be wrong or the repair may not have completed cleanly.
If the local component store is damaged, SFC may not work because it depends on that repaired image as its source. In that case, using install.wim is the correct escape hatch. The goal is not to add extra tools; it is to give DISM a healthy source it can trust.
What happens after DISM finishes?
After DISM finishes, run SFC to verify system files and replace missing or corrupted ones using the repaired image as the source. That sequence matters because DISM fixes the servicing foundation first, and SFC uses that foundation second. If both pass, the image and file set are in much better shape.
A clean finish looks straightforward. DISM completes without errors, SFC completes without reporting unrepaired files, and Windows boots normally. A failed finish usually means one of two things: the source is bad, or the image still needs repair work that was not resolved by the first pass.
- Pass check: /CheckHealth reports no component store corruption, or /RestoreHealth completes cleanly and
sfc /scannowreports no integrity problems. - Fail check: DISM returns a source error, /ScanHealth reports corruption that will not clear, or SFC still finds files it cannot repair after DISM.
What DISM does not change is just as important. It does not erase personal files, and it generally does not remove installed apps. It is aimed at Windows servicing files, the component store, and related image health. If your goal is only to clear ordinary clutter, do not jump to image repair.
What DISM does not change
DISM cleanup is non-destructive to personal files and installed apps. It is built to service Windows images, not to act as a reset tool. That makes it safe for the common case where the machine is low on space or update cleanup is flaky, provided you choose the right command for the symptom.
A common first-time mistake is to run /RestoreHealth immediately because Windows feels slow. That is usually too much. If the only issue is disk pressure after a big update, start with Disk Cleanup and /StartComponentCleanup; use repair commands only when health checks show a real problem.
Another common case: a user runs Disk Cleanup, reboots, and still has the same low-space warning. That does not automatically mean the image is broken. It may mean WinSxS still has superseded components that /StartComponentCleanup can remove, or that a different folder is filling the disk.
Frequently asked questions
How do I use DISM after Disk Cleanup to remove deeper Windows component store files?
Open an elevated Command Prompt or Terminal and run Dism /Online /Cleanup-Image /StartComponentCleanup. That is the cleanup command for the component store itself. If health looks questionable, follow with /CheckHealth and, only if needed, /ScanHealth and /RestoreHealth.
What DISM command should I run before or after Disk Cleanup on Windows 10 or 11?
If you only want safe cleanup, run Dism /Online /Cleanup-Image /StartComponentCleanup after Disk Cleanup. If the system may be damaged, start with /CheckHealth, then /ScanHealth, then /RestoreHealth. The order is cleanup first, then health checks, then repair if the checks justify it.
Is it safe to use DISM to clean up the component store on Windows?
Yes. DISM cleanup is designed for the Windows component store and does not delete personal files or installed apps. The important part is choosing the right command. /StartComponentCleanup is for removing superseded components, while /RestoreHealth is for repair when the store is actually unhealthy.
What is the difference between DISM CheckHealth, ScanHealth, and RestoreHealth?
/CheckHealth is the fast check, /ScanHealth is the deeper scan, and /RestoreHealth repairs the Windows component store when damage is found. Use them in that order. That sequence keeps you from running a long repair when a quick health check already answers the question.
Do I need administrator rights to run DISM cleanup commands?
Yes. Administrator privileges are required before DISM or SFC can change protected system files. Open Command Prompt or Terminal as administrator, then run the cleanup or repair command. Without elevation, Windows may block the operation or return an access-related error.
What should I do if DISM needs a source file or install.wim?
Use mounted Windows installation media and point DISM to install.wim with the /Source option. That is the usual fix when the local source is damaged. If the source is wrong or incomplete, DISM may still fail, so match the image to the installed Windows edition and version.