Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

iTechGuides is reader-supported. When you buy through links on our site, we may earn an affiliate commission. As an Amazon Associate I earn from qualifying purchases. Learn more

Most DISM repairs come down to one pattern: choose the target, choose the servicing option, then add a repair source only when you need one. For the running Windows installation, the everyday repair is DISM /Online /Cleanup-Image /RestoreHealth. For an offline Windows image, replace /Online with /Image:<path_to_image_directory>. The rest of this page explains the pattern, the health-check commands, the repair-source options, and the commands that need a warning before you run them.

Start with the target: online or offline

DISM (Deployment Image Servicing and Management) is a Windows command-line tool for servicing Windows images. Microsoft describes it as handling tasks such as installing, uninstalling, configuring, and updating Windows features, packages, drivers, and international settings. It ships with Windows and is also distributed in the Windows Assessment and Deployment Kit (ADK). Every DISM command starts by naming the image it works on:

DISM.exe {/Image:<path_to_image_directory> | /Online} [dism_global_options] {servicing_option} [<servicing_argument>]

The target selector comes first, and the operation and its arguments follow it. Most readers only ever need two targets:

What’s actually slowing this PC down?

Pick the symptom - the matching free tool is one click away.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.
Target What it points at Typical example When to use it
/Online The Windows installation you are currently running DISM /Online /Cleanup-Image /RestoreHealth Repairing the PC you are sitting at
/Image:<path> An offline Windows image stored in a directory, such as a mounted image or a folder you have prepared DISM /Image:C:offline /Cleanup-Image /RestoreHealth Servicing a Windows image that is not booted, or one you are building for deployment

Not every servicing option works against both targets. Option availability varies by command and Windows version, so check Microsoft’s option reference for the exact command before you rely on it in deployment work.

Image health commands: check, scan, restore

The /Cleanup-Image option handles component-store health. Its three health switches are easy to confuse because they sound similar, but each does a different job:

Switch What it does What it does not do
/CheckHealth Checks whether the image has been flagged as corrupted, and whether that corruption can be repaired It does not perform a full scan of the component store
/ScanHealth Scans the component store for corruption It does not repair anything
/RestoreHealth Scans, then performs repair operations automatically It is not a quick flag check; it can take several minutes

A typical escalation for an online installation runs the three in order, from fastest to most thorough:

DISM /Online /Cleanup-Image /CheckHealth
DISM /Online /Cleanup-Image /ScanHealth
DISM /Online /Cleanup-Image /RestoreHealth

For an offline image, substitute the offline directory in each line, for example DISM /Image:C:offline /Cleanup-Image /ScanHealth. Expect the scan and restore steps to run for several minutes, and do not interrupt them.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

Repairing with a known-good source

By default, /RestoreHealth can draw replacement files from Windows Update. Two switches change that behaviour:

  • /Source:<filepath> tells DISM to use known-good repair files from a location you specify.
  • /LimitAccess stops DISM from contacting Windows Update for repair of an online image.

Microsoft’s example uses the Windows directory of a mounted image as the source:

DISM /Online /Cleanup-Image /RestoreHealth /Source:C:testmountwindows /LimitAccess

The source must correspond to the image you are repairing. An arbitrary Windows folder or installation medium will not work just because it contains Windows files. If you add /LimitAccess without a valid /Source, the repair has no alternative location to draw from, so confirm the source path before running it.

Repair path Repair source Is /LimitAccess needed?
Default online repair Windows Update No
Online repair from a known-good copy The location given by /Source Yes, if you want to keep Windows Update out of the repair
Offline repair Set by /Source for the offline image Not applicable to offline images in the example above

For a quick check of an online installation, Microsoft’s repair guidance also mentions sfc /scannow. Treat it as a separate system-file check rather than a substitute for DISM’s component-store repair. If SFC reports problems it cannot fix, the DISM repair path above is the next step.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

Other command families

DISM has more than repair. Each family below uses the same target selector, but the arguments and version support differ.

Packages and features

DISM can list and service packages and Windows features. Microsoft’s package reference covers /Get-Packages, /Get-PackageInfo, /Add-Package, and feature operations. Package applicability can depend on the Windows version and the package type, so read the reference for your release before applying a package to an image.

Drivers

Driver servicing works with INF-style driver packages. /Get-Drivers lists the driver packages in an image, and /Add-Driver adds third-party driver packages to an offline image. Windows Installer packages and other driver package types such as .exe installers are not supported by these commands, so do not point /Add-Driver at a vendor setup program. Extract or obtain the INF-based driver package first.

Image management

DISM also mounts, applies, captures, and manages Windows images. Capturing can produce a WIM file or a split SWM set. The documented capture option does not capture a VHD or VHDX file. Image management is a deployment topic with its own workflow, so use Microsoft’s image-management reference for the full sequence.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

Using PowerShell instead

The same servicing functions are available in PowerShell. Microsoft maps /Cleanup-Image /ScanHealth and /Cleanup-Image /RestoreHealth to the Repair-WindowsImage cmdlet with the -ScanHealth and -RestoreHealth parameters. If you already work in PowerShell, this is the easier path to remember.

Independent reader supportYour contribution helps us test, update, and keep practical guides available for everyone.Support on Ko-Fi

Commands that remove recovery options

/StartComponentCleanup shrinks the component store, and adding /ResetBase makes the cleanup more aggressive. Microsoft’s package servicing documentation states that once you run /StartComponentCleanup with /ResetBase, installed Windows updates can no longer be uninstalled. That is a permanent change to your rollback options, so treat it as a deliberate decision rather than a routine way to free disk space.

Syntax and supported options for cleanup commands also vary by Windows version. Current Windows 11 users should start with the Windows 11 view of the command reference, not an older article.

Pick the command by task

  • Verify that the running Windows image is healthy: /Online /Cleanup-Image /CheckHealth, then /ScanHealth if needed.
  • Repair the running image with Windows Update: /Online /Cleanup-Image /RestoreHealth.
  • Repair the running image from a known-good copy only: /Online /Cleanup-Image /RestoreHealth /Source:<path> /LimitAccess.
  • Repair an offline image: /Image:<path> /Cleanup-Image /RestoreHealth, with a valid source where required.
  • Add a driver to an offline image: /Image:<path> /Add-Driver with an INF-based package.
  • Use PowerShell: Repair-WindowsImage with -ScanHealth or -RestoreHealth.

Product prices and availability are accurate as of the date/time indicated and are subject to change. Any price and availability information displayed on Amazon at the time of purchase will apply.

Free tools Windows power users keep installed

One-click scans. No signup required.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.