The Windows operating system provides a robust set of command-line tools designed to maintain system integrity. Among them, the Deployment Image Servicing and Management (DISM) tool is perhaps the most critical for repairing the Windows Component Store. However, many users encounter a frustrating roadblock known as Error 87. Typically accompanied by the message "The parameter is incorrect," this error indicates that the command entered was not recognized or could not be processed by the system.

If you are seeing Error 87, the good news is that it rarely signifies catastrophic hardware failure. Instead, it is almost always a result of minor formatting mistakes, insufficient permissions, or version mismatches. This article provides an exhaustive deep dive into why this error occurs and the step-by-step methods required to resolve it across various Windows environments.

Quick Fix for DISM Error 87

If you need an immediate solution, the most common reason for Error 87 is a simple missing space in the command line. Ensure your command is formatted exactly like this:

DISM /Online /Cleanup-Image /RestoreHealth

Notice the space before every forward slash (/). If you typed DISM/Online/Cleanup-Image/RestoreHealth without spaces, Windows will return Error 87 every time. Additionally, ensure you are running the Command Prompt as an Administrator.

Understanding the Role of DISM in Windows

To effectively fix DISM Error 87, it is helpful to understand what the tool actually does. DISM is a command-line utility used to repair, prepare, and service Windows images, including the Windows Recovery Environment, Windows Setup, and Windows PE.

When you run the /RestoreHealth command, DISM looks at the Windows Component Store (located in the C:\Windows\WinSXS folder) to find corrupted files and replaces them with healthy versions from Windows Update servers. Because it interacts with core system files and protected directories, the tool is extremely sensitive to how commands are phrased and the environment in which they are executed.

Primary Causes of DISM Error 87

Before diving into the fixes, let’s categorize the common triggers for this error:

  1. Syntax and Formatting Errors: This accounts for the vast majority of cases. Command Prompt is a literal environment; a missing hyphen, an extra space, or a missing space renders the instruction "unknown."
  2. Lack of Elevated Privileges: DISM requires full administrative access. Running it in a standard user terminal will lead to parameters being rejected.
  3. Windows Version Incompatibility: Certain DISM parameters, such as /RestoreHealth, were introduced in Windows 8. If you attempt to use them on an unpatched Windows 7 system, the parameter will be flagged as incorrect.
  4. Service Conflicts: DISM relies on the Windows Modules Installer service. If this service is disabled or stuck, the cleanup-image option may fail.
  5. Corrupted DISM Binaries: In rare cases, the DISM tool itself or its dependent DLLs (like sysprep-provider.dll) may be corrupted.

Method 1: Verifying Command Syntax and Spacing

In our experience troubleshooting Windows deployment issues, nearly 90% of Error 87 instances are solved by correcting the command syntax. The Command Prompt is not as forgiving as a modern search engine.

The Correct Way to Type DISM Commands

Each switch in a DISM command must be separated by a space. Here are the three most common commands used for system repair:

  • CheckHealth: DISM /Online /Cleanup-Image /CheckHealth (Checks if corruption is present).
  • ScanHealth: DISM /Online /Cleanup-Image /ScanHealth (Scans the component store for corruption).
  • RestoreHealth: DISM /Online /Cleanup-Image /RestoreHealth (Scans and repairs corruption).

Common Typing Mistakes to Avoid

  • Missing Spaces: DISM /Online/Cleanup-Image (Incorrect) vs. DISM /Online /Cleanup-Image (Correct).
  • Incorrect Hyphens: /CleanupImage (Incorrect) vs. /Cleanup-Image (Correct).
  • Typos in Keywords: /Restore-Health (Incorrect) vs. /RestoreHealth (Correct - no hyphen between Restore and Health).

Pro Tip: To eliminate the risk of typos, copy the command from a reliable source and paste it into the Command Prompt by right-clicking in the terminal window.

Method 2: Running Command Prompt with Administrative Privileges

Windows protects its system files via User Account Control (UAC). DISM is a high-level tool that can modify the operating system's kernel-level files, so it cannot function in a "standard" user environment.

How to Open an Elevated Command Prompt

  1. Click the Start button or press the Windows Key.
  2. Type cmd into the search bar.
  3. On the right-hand side of the search results, click Run as administrator. Alternatively, right-click "Command Prompt" and select the option from the context menu.
  4. A UAC prompt will appear asking, "Do you want to allow this app to make changes to your device?" Click Yes.
  5. Check the title bar of the window. It should say Administrator: Command Prompt.

If you run DISM without these steps, you will likely receive Error 87 or Error 740 (The requested operation requires elevation).

Method 3: Running the System File Checker (SFC) First

Sometimes, the system files required to run DISM are themselves damaged. In such a scenario, the repair tool cannot repair itself. We recommend running the System File Checker (SFC) as a preliminary step.

The SFC-DISM Relationship

While DISM repairs the "Component Store" (the source files), SFC repairs the "System Files" (the files currently in use by Windows). If the source is corrupted, SFC will fail. If the SFC tool's underlying engine is damaged, DISM might throw Error 87.

  1. In the Elevated Command Prompt, type: sfc /scannow
  2. Press Enter.
  3. Wait for the verification to reach 100%.
  4. If it says "Windows Resource Protection found corrupt files and successfully repaired them," try running your DISM command again.
  5. If it says "Windows Resource Protection could not perform the requested operation," restart your computer in Safe Mode and try again.

Method 4: Ensuring Windows Updates and Services are Active

DISM often uses Windows Update as a source to download "known good" versions of corrupted files. If your Windows Update service is broken or the system is significantly out of date, DISM may encounter a parameter error.

Check the Windows Modules Installer

This service is responsible for installing, modifying, and removing Windows updates and optional components. If it is disabled, DISM cannot access the /Cleanup-Image parameters.

  1. Press Win + R, type services.msc, and press Enter.
  2. Scroll down to find Windows Modules Installer.
  3. Double-click it.
  4. Set the Startup type to Manual or Automatic.
  5. If the service status is "Stopped," click Start.
  6. Click Apply and OK.

Run Windows Update

An outdated OS can lead to compatibility issues with newer DISM definitions.

  1. Go to Settings > Windows Update.
  2. Click Check for updates.
  3. Install any pending cumulative updates and restart your PC.

Method 5: Addressing Windows 7 Compatibility Issues

A frequent query we see is users trying to run /RestoreHealth on Windows 7 and receiving Error 87. It is important to note that the /RestoreHealth parameter was not natively included in the original version of Windows 7.

If you are using Windows 7:

  • The /RestoreHealth command will always return Error 87 because the OS doesn't know what that parameter is.
  • Instead, Windows 7 users should use the System Update Readiness Tool (KB947821). This tool performs the same function as DISM /RestoreHealth but is a standalone executable provided by Microsoft.
  • Alternatively, stick to the sfc /scannow command for file repairs on legacy systems.

Method 6: Using the Correct DISM Version (Deployment Image Issues)

If you are a technician trying to apply a Windows 10 or Windows 11 image (.wim) using a version of DISM from an older Windows PE or Windows 8.1 environment, you will hit Error 87.

Microsoft updated the DISM engine to support "Compact OS" and other compression features in Windows 10. Older versions of DISM cannot interpret these new image parameters.

Solution: Use the Windows ADK

To service a newer Windows image, you must use the version of DISM that matches the image version.

  1. Download and install the Windows Assessment and Deployment Kit (Windows ADK) for your specific Windows version.
  2. Use the Deployment and Imaging Tools Environment (which comes with the ADK) to run your commands instead of the standard Command Prompt.
  3. This ensures the wofadk.sys filter driver is present, allowing DISM to handle modern compressed images correctly.

Method 7: Advanced Fix - Using an ISO as a Repair Source

If DISM continues to fail with Error 87 or cannot find the source files (even when syntax is correct), you can bypass the "Online" mechanism and point DISM to a physical Windows installation media (ISO).

Step-by-Step ISO Repair

  1. Download the Windows ISO that matches your current version and build (use the Media Creation Tool).
  2. Double-click the ISO file to Mount it. Note the drive letter (e.g., Drive D:).
  3. Open an Elevated Command Prompt.
  4. Run the following command (replace D: with your actual drive letter): DISM /Online /Cleanup-Image /RestoreHealth /Source:WIM:D:\sources\install.wim:1 /LimitAccess
  5. The /Source parameter tells DISM to look at the ISO for clean files, and /LimitAccess prevents it from trying to use Windows Update.

This method is highly effective for systems with limited internet connectivity or those where the Windows Update components are severely damaged.

Method 8: Re-registering DISM DLLs

In rare instances, Error 87 occurs because the specific DLL responsible for the Cleanup-Image function has become unregistered or corrupted.

  1. Navigate to C:\Windows\System32\Dism.
  2. Look for sysprep-provider.dll.
  3. If you suspect it is corrupted, some technicians copy this file from a working PC of the identical Windows build and replace the local copy (though this should be a last resort).
  4. More safely, try running a repair installation (In-place Upgrade) if the DISM binaries are truly broken.

Method 9: Handling Error 87 in WinRE/WinPE

If you are running DISM from the Windows Recovery Environment (the blue screen options when your PC won't boot), you cannot use the /Online switch.

  • Incorrect: DISM /Online /Cleanup-Image /RestoreHealth (while in Recovery).
  • Correct: You must point to the offline Windows installation. DISM /Image:C:\ /Cleanup-Image /RestoreHealth (Note: In the recovery environment, your Windows drive letter might not be C:. Use dir C:, dir D:, etc., to find the drive containing the "Windows" folder).

Frequently Asked Questions (FAQ)

Why does DISM say "The cleanup-image option is unknown"?

This is the most common manifestation of Error 87. It usually means there is a missing space before /Cleanup-Image or you are running an outdated version of DISM that doesn't support that specific flag.

Can I run DISM on a Mac or Linux?

No, DISM is a proprietary Windows tool designed to service Windows Imaging Format (.wim) files and the Windows VHD/VHDX formats.

Is Error 87 a sign of a failing hard drive?

Not directly. Error 87 is a software/syntax error. However, if your command syntax is perfect but DISM fails repeatedly, you may have underlying "Bad Sectors" on your drive. In this case, run chkdsk c: /f /r to check for hardware issues.

Does DISM delete my personal files?

No. DISM only interacts with system image files and the Windows Component Store. It does not touch your Documents, Pictures, or personal data. However, it is always a best practice to have a backup before performing system repairs.

How long does a DISM scan take?

Depending on your hardware (SSD vs. HDD) and the extent of the corruption, a /RestoreHealth scan can take anywhere from 10 to 40 minutes. It may appear to "hang" at 20% or 85%—this is normal behavior as the tool performs deep integrity checks.

Conclusion and Summary

Fixing DISM Error 87 is typically a matter of attention to detail rather than complex technical repair. In our experience, the vast majority of users can resolve the issue by simply:

  • Ensuring an Elevated Command Prompt is used.
  • Adding spaces before every / slash.
  • Checking for typos in the /Cleanup-Image or /RestoreHealth parameters.

If basic syntax corrections don't work, the issue likely lies with the Windows Modules Installer service, Windows 7 compatibility limitations, or the need for a physical ISO source. By following the structured methods outlined above, you can restore your Windows Component Store to a healthy state, ensuring your system remains stable, secure, and ready for future updates. If all DISM and SFC attempts fail, consider a Reset This PC (Keep my files) or an In-place Upgrade as the final software-based solution.