DriversRecommendedOutdated drivers can make a good PC feel brokenScan driver issues before chasing fixes manually.Scan NowHalloween DealsAmazon USHalloween week deals: useful picks before month-endAmazon US: current deals, useful picks and tech finds.Check DealsClean PCRecommendedOne scan can reveal what keeps slowing WindowsLook for cleanup and repair opportunities.Run Scan×
Skip to content
World desk4 min

DISM Syntax Cheat Sheet: The Commands You Use Most, and How They Fit Together

Every DISM command follows a target, servicing group, and operation pattern. Here is the syntax for Windows repair, repair sources, and other common tasks.
Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

Almost every DISM command follows the same three-part pattern: choose a target, name the servicing group, then give the operation. For Windows repair on the PC you are using, that means DISM /Online /Cleanup-Image /RestoreHealth. Once you recognize the pattern, most of the syntax becomes a matter of swapping one word, not memorizing a list. This guide gives you that pattern, the repair switches you will reuse, and the handful of options that deserve a warning before you run them.

Start with the target: running Windows or an offline image

DISM (Deployment Image Servicing and Management) is a command-line tool for servicing Windows images. It is installed with Windows and is also distributed in the Windows Assessment and Deployment Kit (ADK). Before you type anything else, decide what you are servicing, because that choice sets the first argument of the command:

As an Amazon Associate I earn from qualifying purchases.

Target Selector to use Typical situation
The Windows installation you are running /Online Repairing the PC you are logged into
An offline Windows image on disk /Image:<path_to_image_directory> Servicing a Windows installation that is not booted, such as a mounted image during deployment work

The general shape is:

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

The selector comes first, followed by the servicing option and its arguments. Run DISM from an elevated Command Prompt or PowerShell window. Not every option works on every target, and support also varies by Windows version, so check Microsoft’s reference for the exact option before relying on it in deployment work.

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

The repair switches you will actually reuse

The repair operations all sit under /Cleanup-Image. Three of them are easy to confuse, and they are not interchangeable labels:

Switch What it does
/CheckHealth Reports whether the image has been flagged as corrupted, and whether that corruption can be repaired.
/ScanHealth Scans the component store for corruption. It does not perform repairs.
/RestoreHealth Scans, then performs repair operations automatically. Expect this to take several minutes.

Source: Microsoft Learn repair and image-servicing documentation for DISM. Commands:

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

For an offline image, replace /Online with the image selector:

DISM /Image:C:offline /Cleanup-Image /RestoreHealth

A safe repair sequence for the running PC

  1. Run DISM /Online /Cleanup-Image /CheckHealth. If it reports no corruption flag, you may not need a repair at all.
  2. If you want a scan without repairs, run DISM /Online /Cleanup-Image /ScanHealth and read the result.
  3. If corruption is reported, run DISM /Online /Cleanup-Image /RestoreHealth. Let it finish; it can take several minutes.
  4. Restart if the operation asks you to, then run the health check again to confirm the result.

Microsoft’s repair guidance also mentions sfc /scannow as a way to check system files on an online image. Treat it as a related system-file check rather than a substitute for DISM’s component-store repair. If you run both, DISM’s /RestoreHealth is the step that repairs the component store that SFC relies on.

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.

Choosing a repair source

By default, an online /RestoreHealth can obtain replacement files from Windows Update. Two options change that behavior:

  • /Source:<filepath> points DISM at known-good repair files. The source must correspond to the same Windows image you are repairing. Do not assume that any arbitrary Windows folder or installation medium will work.
  • /LimitAccess stops DISM from contacting Windows Update for repair of an online image.
Scenario Repair source Is /LimitAccess needed?
Online repair with default settings Windows Update No
Online repair using a known-good copy you supply The path given to /Source Yes, if you want to block Windows Update as a source

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

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

Command families beyond repair

Repair is only one of DISM’s jobs. The other families follow the same selector-first pattern, but each has its own limits.

Packages and features

DISM can list and service packages and Windows features. The package options include /Get-Packages, /Get-PackageInfo, and /Add-Package. Feature operations, such as /Get-Features and /Enable-Feature, follow the same pattern. Which package types apply depends on the Windows version and the package itself, so confirm against the reference for your release.

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

Drivers

/Get-Drivers lists driver packages. /Add-Driver adds third-party driver packages to an offline image, and the documented input is INF-style driver packages. DISM’s driver commands do not accept Windows Installer packages or vendor .exe installers, so do not point /Add-Driver at a setup program.

DISM /Image:C:offline /Add-Driver /Driver:C:driversmydriver.inf

Image management

DISM also manages whole images: mounting, applying, and capturing. Capturing can produce a WIM file or a split SWM set. The documented capture option does not capture a VHD or VHDX file. Full deployment workflows are beyond this reference, so use Microsoft’s image-management documentation for those steps.

PowerShell equivalents

If you prefer PowerShell, DISM’s health operations are available as cmdlets. Microsoft maps the following:

Repair-WindowsImage -ScanHealth
Repair-WindowsImage -RestoreHealth

These correspond to /Cleanup-Image /ScanHealth and /Cleanup-Image /RestoreHealth. Running them from an elevated PowerShell session is the usual approach.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.
Independent reader supportYour contribution helps us test, update, and keep practical guides available for everyone.Support on Ko-Fi

Commands to use with care

Do not run /StartComponentCleanup /ResetBase as a routine way to free disk space. Microsoft’s package servicing documentation states that after you run /StartComponentCleanup with /ResetBase, installed Windows updates can no longer be uninstalled. Other cleanup options may be safer for everyday use, and the exact options available vary by Windows version, so read the Windows 11 version of the command reference before you run any cleanup switch.

Keep this distinction in mind as well: the health switches in this guide read and repair the component store, while cleanup switches change what is retained. They serve different purposes, and a repair does not need a cleanup.

Also check your version assumptions. The syntax above reflects Microsoft’s current command reference for Windows 11. Older releases may support fewer options, so if a command returns an unrecognized-option error, look up the option for your specific Windows build.

Finally, keep the target straight. Most mistakes come from running an online command against an offline image or the reverse. Before you press Enter, confirm whether you wrote /Online or /Image:.

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

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.

Leave a Reply

Your email address will not be published. Required fields are marked *

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.

More from the Wire

  1. World desk4 min
    How to Spot an AI Voice Scam Before Sending MoneyDon’t rely on how a caller sounds. Pause, call back through a known number, and verify the emergency with another trusted person before sending money.
  2. Mountain View desk4 min
    Google’s SynthID Detector: How to Check AI-Generated Images, Video and AudioGoogle’s SynthID Detector looks for an embedded watermark in supported images, video and audio. Here is what its results do—and do not—show.
  3. Redmond desk20 min
    How to create a link to File or Folder in Windows 11Windows 11 gives you several ways to point to a file or folder without moving or duplicating it. You can create a desktop shortcut,…
Recommended PC Tool
Recommended PC Tool
Crashes, No Sound, or Screen Glitches?Free driver scan
Windows Errors? Fix Them Before They SpreadFree repair scan

Two free Windows tools

One Free Minute Could Fix That PC

Before you go - each of these free tools takes about a minute and tackles what quietly slows a Windows PC down.

Special offer. View Outbyte info, uninstall instructions, EULA, and Privacy Policy.