sodcalculator

10 Tech How-To

How to Fix DISM Error 87 on Windows

Guide 10-38585 · Updated · Step by step

DISM (Deployment Imaging Service and Management) is a built-in Windows tool used to repair system image corruption. Error 87 typically appears when you mistype a command or use an unsupported parameter, but it can also stem from syntax issues or missing administrative rights. This guide walks you through the exact steps to diagnose and fix the problem, from verifying your command syntax to running the tool with the correct privileges.

What You’ll Need

  • A Windows PC (Windows 10 or 11 recommended)
  • Administrator account access
  • An internet connection (for the online repair option)

Step-by-Step

  1. Open Command Prompt as Administrator. Press Windows + X and select “Terminal (Admin)” or “Command Prompt (Admin)”. If prompted by User Account Control, click “Yes”.
  2. Check your DISM command syntax. Error 87 often means the command you typed is not recognized. The most common DISM commands are:
    • DISM /Online /Cleanup-Image /RestoreHealth – repairs the current Windows image
    • DISM /Online /Cleanup-Image /ScanHealth – checks for corruption
    • DISM /Online /Cleanup-Image /CheckHealth – quick check

    Make sure there are no extra spaces, missing slashes, or typos. For example, /Online must be exactly that, not /online (though DISM is case-insensitive, it’s safer to match the standard).

  3. Run the command with proper syntax. Copy and paste the exact command from the step above into the admin prompt and press Enter. If you see error 87 again, proceed to the next step.
  4. Ensure you are using the correct DISM version. On Windows 10/11, DISM is included. If you are using an older Windows version (like 7 or 8), some parameters may not be supported. In that case, update your Windows or use the built-in System File Checker (SFC) as an alternative.
  5. Verify that the Windows image is mounted (if using offline images). If you are trying to repair a mounted WIM or VHD image, error 87 can occur when the image is not mounted or the path is incorrect. Use DISM /Get-MountedImageInfo to list mounted images, and ensure your command references the correct mount path.
  6. Check for missing or extra parameters. For example, /RestoreHealth does not require a source, but if you add /Source incorrectly, you may get error 87. If you need a source, use the correct syntax: DISM /Online /Cleanup-Image /RestoreHealth /Source:C:\RepairSource\install.wim (adjust the path).
  7. Run DISM in an elevated PowerShell (alternative). Sometimes the command prompt may have restrictions. Open PowerShell as administrator and run the same command. This can bypass certain environment issues.
  8. If all else fails, run System File Checker. Type sfc /scannow and press Enter. This will check and repair system files, which may resolve underlying issues that cause DISM to fail.

Common Mistakes

  • Typing the command with a lowercase “dism” – while DISM is case-insensitive, some users accidentally add a space before the slash, like DISM /Online vs DISM / Online. The space after the first slash is correct, but not before it.
  • Using /Cleanup-Image without the preceding /Online or /Image: parameter – DISM requires a target. If you omit the target, error 87 is common.
  • Running DISM without admin rights – Even if you are logged in as an administrator, you must explicitly open the command prompt as administrator. Right-click and select “Run as administrator”.
  • Adding unsupported switches – For example, /RestoreHealth /Source is valid, but /RestoreHealth /LimitAccess is a separate switch; mixing them incorrectly can trigger error 87.
  • Using a 32-bit command prompt on a 64-bit system – If you are using a 32-bit version of the command prompt, some DISM commands may not work. Always use the 64-bit version (default in Windows).

Tips

  • Always copy and paste commands from a trusted source to avoid typos.
  • If you are repairing an offline image, ensure the image is not corrupted before mounting.
  • For online repairs, a stable internet connection is required because DISM may download files from Windows Update.
  • Consider running chkdsk first to rule out disk errors that might interfere with DISM.
  • If you are in a corporate environment, group policies may block certain DISM operations. Contact your IT admin.

Troubleshooting

If the above steps do not resolve error 87, try these additional checks:

  • Check for typos in the image path. If you are using /Image:, make sure the path is correct and does not contain spaces (or use quotes). For example: DISM /Image:C:\Mount /Cleanup-Image /RestoreHealth.
  • Update Windows. Some DISM bugs are fixed in cumulative updates. Go to Settings > Update & Security > Windows Update and install all pending updates.
  • Use the Windows Media Creation Tool to repair. If DISM is completely broken, you can create a bootable USB and use “Repair your computer” > “Troubleshoot” > “Command Prompt” to run DISM from the installation media.
  • Check if your antivirus is interfering. Temporarily disable third-party antivirus and run DISM again. Re-enable it afterward.
  • Look at the CBS log. After a failed DISM, check C:\Windows\Logs\CBS\CBS.log for detailed error codes. This can give more specific clues.

Frequently Asked Questions

What exactly causes DISM error 87?

Error 87 means “The parameter is incorrect.” It most often occurs due to a typo in the command, an unsupported parameter for your Windows version, or a missing required argument.

Can I fix error 87 by running DISM as a regular user?

No. DISM requires administrative privileges. You must run the command prompt as administrator. Right-click the Start button and choose “Terminal (Admin)” or “Command Prompt (Admin)”.

Is DISM error 87 the same as error 87 in other Windows tools?

Not necessarily. Error 87 is a generic Windows error code that means “incorrect parameter.” It can appear in various contexts, but in DISM it specifically relates to command-line syntax.

Will running SFC fix DISM error 87?

Sometimes. If the DISM executable itself is corrupted, SFC can repair it. However, SFC does not directly fix command syntax errors. Run SFC after you have verified your command syntax.

Do I need an internet connection to run DISM /RestoreHealth?

Yes, if you use the default source. DISM will contact Windows Update to download necessary files. If you have no internet, you can specify a local source using the /Source parameter.

Can I use DISM on Windows 7?

Yes, but the syntax may differ slightly. For example, /Online is not supported in Windows 7; you must use /Image: with a mounted image. Check Microsoft’s documentation for your specific version.

Related

General steps for current mainstream versions; menus can differ by device and version. See the disclaimer or report an error.

More in this bed

The whole Tech How-To bed →