So, I've read Microsoft's documentation, and it ends up being a lot of words that don't explain anything. I've seen other places of people using DISM commands, but it doesn't explain what they do.

I know DISM is used for working with images before deployment, but people are using it for repairing a running instance of Windows. How exactly does it do that? Does it use some files from SxS?

What about when Windows does a "Refresh" or "Reinstall", does it use something similar or some files from a recovery partition?

Dani AI

Generated

Short answer: DISM services the Windows component store (the WinSxS repository and the servicing stack) and can repair either an offline image or the running (online) image by fixing the component store and then letting normal servicing or SFC restore the live files. It doesn’t “magically patch” random in-use files — it checks the component store’s integrity and replaces bad component bits from an approved repair source so subsequent repairs take effect. (learn.microsoft.com)

How the pieces fit together: DISM will scan the component store, flag corruption, and then obtain replacement payloads from the configured repair source (by default the Features-on-Demand/Windows Update path, or a manually specified WIM/ESD/mounted image or local component store). After DISM repairs the store, run the System File Checker so it can copy correct files into the running system if needed. For details on the repair sources and the recommended DISM→SFC sequence see Microsoft’s guidance. (learn.microsoft.com)

Cleanup vs repair: DISM has separate subcommands for cleaning the component store (removing superseded backups and reducing WinSxS size). That cleanup work is different from component-store repair — cleanup reclaims space and may remove rollback copies, while repair restores missing/corrupt component files. Treat the two tasks as distinct and back up before you remove base files. (learn.microsoft.com)

Refresh/Reset/Reinstall: the Reset/Refresh workflow is a reinstall path — it either uses a local recovery image (recovery partition or local reinstall files on the device) or a cloud download to get a fresh Windows image. That process reinstalls Windows (not just repairing the component store) and so is a different mechanism than DISM’s image servicing. If DISM can’t repair because it can’t find a correct source, use matching install media or the recovery image for the repair source, then re-run the store-repair step and SFC. For Reset/Refresh behavior see Microsoft’s Reset documentation. (support.microsoft.com)

Practical tip (safe and immediate): after image-repair steps, run SFC to finalize live-file fixes:

sfc /scannow

See Microsoft Support for log locations and further troubleshooting. (support.microsoft.com)

Notes: this explains the difference between the repair path you asked about (the /RestoreHealth-style flow) and the component cleanup approach described; ’s intuition that the component store is involved is correct, and ’s point about using a full image when damage is deep is also the right fall-back. (learn.microsoft.com)

Recommended Answers

All 4 Replies

I read your post twice and can't determine what you are trying to do. Yes, you ask some questions but what you are trying to accomplish is unclear.

The only thing I've ever used dism for is to reduce the space used by my current Windows OS and the command and options I use aren't displayed when you type dism /?. The command I use is

DISM /online /Cleanup-Image /SpSuperseded

This is what you would run after installing a service pack. It deletes all of the Windows uninstall files associated with the service pack.

rproffitt:

Some people use DISM to repair the currently running version of Windows when it will not perform updates properly. The command they use is: DISM.exe /Online /Cleanup-image /Restorehealth

I know DISM is a tool used for working with offline images. So, I am wondering why DISM is also used for repairing the currently loaded OS. How does it achieve this? Does it use SxS to do that?

Reverend Jim: So, you are using the tool also to cleanup what seems to be packages under WinSxS. Microsoft really gets on my nerves when they cram too much into one tool so that it deals with unrelated areas.

Thank you both for your earlier and future replies.

@Sphinx. Interesting. While I've only be around PCs since about the model 5150 I never used DISM to repair a busted Windows. At the office we use images if the damages is deep enough that old SFC won't do along with those usual malware scans.

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.