How to Fix DISM Error 87 on Windows 11

Facing the DISM Error 87 on your Windows 11 PC? Use these 5 ways to resolve it and get things working smoothly again.

DISM stands for Deployment Image and Servicing Management and is a command-line tool that allows you to service and repair damaged or corrupted system files on your computer.

DISM proves to be a very crucial tool for the Windows operating system, as it maintains the health of the image that will be used to restore/recover your PC in case anything goes haywire. To technically elaborate the functionality of the tool a bit, it helps service WIM (Windows Imaging Format) files, Virtual Hard disk (.VHD/.VHDX) files along with preparing Windows Images.

Now, if you are trying to run a DISM command and facing the Error 87, worry not, as this guide will serve you just right and help you resolve it properly.

That being said, before you take a deep dive into the instructions on how to resolve this error, it is highly recommended to learn why you are facing this error in the first place. Since the error presents itself due to human error in most cases, knowing about the causes will help you eliminate the possibility of facing it again.

Probable Causes of Facing the DISM Error 87

  • One of the most common causes of facing this error is trying to execute an incorrect command. If you are pasting the command directly in the Command Prompt, make sure there are no spelling mistakes. To add to that, if you are typing it yourself, pay heed to the spaces and typing errors to make sure the command is grammatically correct.
  • Another reason that many people experience the error 87 is that they tend to forget to open the Command Prompt with elevated privileges. Since DISM is a very crucial and core tool for the operating system, it requires administrator rights to execute it. Hence, make sure you are either logged in as an admin or at least have the Command Prompt window opened as administrator.
  • An improper Windows 11 installation can also cause this error to present itself.
  • This issue can also arise due to the service of an operating system that is more recent than the installed DISM version on the PC. To elaborate more on it, a DISM version 1511 can service an operating system version 1511 as well as 1507, but it cannot be used to service the operating system version 1607.

In case you are trying to service a different image than the host image, you can find the official list of supported DISM versions from Microsoft and the image files that can be serviced with it.

Now that you have a bit more information about the error than before, it is time that you tackle the issue head-on using the solutions provided below. As listed, there could be more than one reason why you are facing this error. So, you might have to perform multiple fixes in order to completely eradicate it from your system.


Method 1: Make Sure the Command is Correct

The first, foremost, and the most elementary solution is to make sure the command you are typing in the window is error-free. In case you are straight away copy+pasting the command from a website, it is recommended that you visit a trusted source and copy+paste the command from there to make sure it is error-free and syntactically correct for your version of DISM.

One of the common mistakes that most users make is the incorrect spacing of the slashes in the command; due to that, the command-line tool cannot correctly identify the command to be executed.

The other mistake as common as missing or misspacing the slashes is either missing out a hyphen or incorrect case of the letters in the command.

Once you have made sure that your command is error-free, try to execute it and see if the issue has been resolved. In case the command is syntactically correct, but you are still facing issues with DISM, head on to the next fix.


Method 2: Open the Terminal or Command Prompt with Admin Privileges

As mentioned earlier in this guide, not opening the Command Prompt or the Terminal window with administrative rights is one of the common issues that tend to bring up this error. Hence, below is a quick refresher on how to do that.

To open an elevated window of Terminal, first, head to the Start Menu and type Terminal in it to perform a search. Then, from the search results, right-click on the ‘Terminal’ tile and then select the ‘Run as administrator’ option from the context menu.

This image has an empty alt attribute; its file name is allthings.how-how-to-exit-safe-mode-on-windows-11-image-5.png

Now, a UAC (User Account Control) window will appear on your screen. If you are not logged in with an admin account, enter the credentials for one. Otherwise, click on the ‘Yes’ button to proceed.

From the Terminal window, click on the ‘Chevron’ icon (downward arrow) and select the ‘Command Prompt’ option from the overflow menu. Alternatively, you can also press Command+Shift+2 keys together on your keyboard. This will open the Command Prompt in a separate tab on the Terminal window.

That’s it, you have successfully opened the Command Prompt with admin privileges on your system. Now, try to execute the commands once again to check if the issue is resolved or not.


Method 3: Boot in Safe Mode and Run DISM

If both the above methods do not seem to work for you, you can also boot into safe mode on your Windows 11 PC, where other than essential Microsoft services, every software and service will be disabled. This will make sure that you do not encounter any third-party interference when restoring the system image.

This method is a two-part process, first, you will need to boot your PC in Safe Mode and then you will be required to run the DISM and SFC command on your system. Both of these parts are listed separately for your ease of convenience.

Start Your PC in Safe Mode

Starting your PC in safe mode is a very straightforward process. All it requires is just a couple of clicks and you will be good to go.

First, open the Start menu and click on the Settings tile from the ‘Pinned apps’ section to continue. Alternatively, you can also press the Windows+I keys together on your keyboard.

Next, make sure the ‘System’ tab has been selected from the left sidebar present in the Settings window.

Now, from the left section of the settings window, scroll down to locate the ‘Recovery’ tile and click on it.

Then, under the ‘Recovery options’ section, locate the ‘Advanced startup’ tile and click on the ‘Restart now’ button present on the far right side of it. This will restart your PC immediately.

Once the PC is restarted, click on the ‘Troubleshoot’ tile present on the ‘Choose an option’ screen to continue.

After that, from the ‘Troubleshoot’ screen, click on the ‘Advanced options’ tile to proceed.

Now, from the ‘Advanced options’ screen, locate and click on the ‘Startup Settings’ tile to continue.

Then, on the next screen, click on the ‘Restart’ button present in the bottom right section of the screen to start your PC in Safe Mode.

Now, once the PC restarts, you will see a list of options displayed on your screen. Press the F5 or 5 key on your keyboard to load the Safe Mode with networking on your system. Internet will be required as in the next step we will be restoring the system image using Microsoft servers.

Fix System Files Using DISM and SFC Commands

Once you have booted the system in Safe Mode, you will need to run the DISM and SFC commands. This action will not only fix your PC but will most probably also refresh and service the system image for which you were running the DISM command in the first place.

To do so, right-click on the Start Menu on your taskbar. Then, click on the ‘Windows Terminal (Admin)’ option to continue.

A UAC (User Account Control) window will appear on your screen. If you are not logged in as an admin, enter the account credentials for one. Otherwise, click on the ‘Yes’ button to continue.

Then, from the Terminal window, click on the chevron (downward arrow) icon from the tab bar. Then, click on the ‘Command Prompt’ option from the overflow menu. Alternatively, you can also press the Ctrl+Shift+2 keys together on your keyboard to open it.

Next, type or copy+paste the following command and hit Ener to restore your system image.

DISM /Online /Cleanup-Image /RestoreHealth

Note: You must have chosen the ‘Safe Mode with Networking’ option after the restart for this command to work.

The DISM command may take up to several minutes depending on the speed of your internet connection. It may also appear stuck at times but it is a normal behavior of the command. Wait patiently till the execution of the command completes.

Once completed, type or copy+paste the below-mentioned command to invoke the SFC (System File Checker) that will scan your currently installed Windows image and fix the damaged or corrupted files using the one you downloaded in the previous step.

SFC /scannow

Once the SFC command is finished executing, close the Command Prompt and restart your Windows computer. It should boot normally. Try to run the DISM command again; it should work as expected this time.


Method 4: Run CHKDSK (Check Disk)

The primary function of the chkdsk command is to check the integrity of the file system on the hard drive and make necessary fixes. The command can also fix bad sectors on your hard drive. Moreover, you can either run the chkdsk from the File Explorer or the Command Prompt at your convenience.

Run CHKDSK Using File Explorer

If you do not wish to type any commands in the Command Prompt, Windows also allows you to run the tool right from the File Explorer.

To do so, first, double-click on the ‘This PC’ icon on your desktop. Alternatively, you can press the Windows+E shortcut on your keyboard to open it.

Now, right-click on the drive you wish to check and choose the ‘Properties’ option from the context menu.

Click the ‘Tools’ tab from the ‘Windows Properties’ window, and then click on the ‘Check’ button in the ‘Error Checking’ section.

If there are no errors on the driver, you might receive a prompt from the system stating so. In case you still wish to continue with the scanning, click on the ‘Scan drive’ option on the prompt. If not, hit the ‘Cancel’ button.

The scan may take a while, wait patiently while the process runs in the background.

Run CHKDSK Using Command Prompt

While this method does not offer the convenience of GUI, it definitely offers complete control and more flexibility in using the commands with the help of parameters.

First, open Windows Terminal as an administrator on your PC. Search for ‘Terminal’ in the Start menu and then right-click on the ‘Windows Terminal’ app from the results and select the ‘Run as administrator’ option from the context menu.

You will next see a UAC (User Account Control) window. If you are not logged in with an admin account, enter the necessary credentials for admin log-in. Otherwise, click on the ‘Yes’ button to launch an elevated window of the Windows Terminal.

Next, click the caret icon (downward arrow) on the Terminal window. Then, select the ‘Command Prompt’ option from the overflow menu. You can alternatively press the Ctrl+Shift+2 to access it as well.

Now, type or copy/paste the following command in the Command Prompt window and press Enter.

chkdsk /f

You may receive a prompt to schedule the chkdsk procedure on the next boot of your computer since the drive cannot be in use while the tool is running its operation. To schedule, press Y on your keyboard.

Finally, shut down your computer from the Start Menu and turn it back on. The chkdsk tool will automatically start scanning the storage volume before the PC boots up.


Method 5: Factory Reset Windows 11

If none of the above-mentioned solutions seem to work for you, the only way to resolve the DISM error is to factory reset your PC. However, do note, that this will remove all files, folders, and settings from your PC and bring it back to a factory state as the name suggests.

First, head to the Start Menu and click on the ‘Settings’ tile present under the ‘Pinned apps’ section to continue. Alternatively, you can also press the Window+I keys together on your keyboard to launch the Settings app.

Now, click on the ‘System’ tab present on the left panel of the ‘Settings’ window.

After that, scroll down and locate the ‘Recovery’ option. Click on it to enter the ‘Recovery’ settings.

Now, on the ‘Recovery Setting’ screen, click on the ‘Reset PC’ button to continue.

After clicking on the ‘Rest PC’ button, a separate window will open.

Now, on the separately opened window, two options would be available to you:

  • Keep my files: As the name suggests, use this option if you want to keep your personal files intact while all the system apps get uninstalled and system settings are rolled back to a fresh state.
  • Remove everything: Again, no surprises here as well. This option will remove all photos, programs, and apps and will roll back the operating system to a completely fresh state as if it was brand new. Due to the nature of the issue, choosing this option is recommended.

So for the purpose of this guide, we are going with the ‘Remove everything’ option here.

After choosing either of the options, on the next window, you will need to choose between a ‘Cloud download’ or a ‘Local reinstall’ option. ‘Cloud download’ is believed to be more reliable and stable relative to ‘Local reinstall’ as there might be a possibility of files being corrupted or damaged.

However, as the name suggests, Cloud download will require a stable internet connection through which Windows will consume at least 4GB of data.

Now, click on the option you would like to select for reinstalling the Windows on your machine. We are choosing the ‘Cloud download’ option here.

Note: Neither of the reinstalling options would require you to plug in any external installation media.

Next, you will be notified of the current settings for resetting the PC. If you wish to change any setting, click on the ‘change settings’ option.

On the ‘Choose settings’ window, you will have three options to alter the settings. Let’s get into it for the sake of better performance of your machine:

  • Clean data?: This option is mostly used when you want to give away your PC and don’t want anybody to be able to recover your personal files. If that’s the case, toggle the switch to the ‘Yes’ position.
  • Delete files from all drives?: As the name suggests, this option would enable you to choose if you would like to remove the data from only your Windows installer drive or wipe all the drives clean. If you wish to delete files from all drives, toggle the switch to the ‘Yes’ position. Also, ‘Clean data’ will apply to all the drives if enabled.
  • Download Windows?: This option would enable you to switch from ‘Cloud download’ to ‘Local reinstall’ should you feel the need to change the reinstallation process before commencing.

Once you have toggled the additional settings as per your preference, click on the ‘Confirm’ button to proceed further. Here we have enabled the ‘Clean data?’ option.

Now, click on the ‘Next’ button from the bottom section of the window.

It might take a while for Windows to load the next screen. Sit tight while the process runs in the background.

Next, Window will list down all the impacts of resetting your PC. Read them and click on the ‘Reset’ button to start the resetting process on your machine.

After clicking the ‘Reset’ button, your computer might restart several times to complete the process, which is entirely normal behavior. Resetting might take a few hours depending on your machine and the settings chosen by you for the process.


There you go folks, hopefully, this guide will help you resolve the DISM error 87 on your computer fairly easily.