DISM (Deployment Image Servicing and Management) is a command tool developed for administrators and experts to scan and repair Windows images including, Windows Recovery Environment, Windows Setup, and Windows PE (WinPE). It is a built-in tool in Windows 11 that can check and repair protected system files and component store of Windows images.

If your Windows 11 PC is not working correctly, apps are not opening, your files get corrupted, you get stuck on a blue screen, and so on, you can run the DISM tool to fix these issues. In most cases, the System File Checker (SFC scan) tool can fix various issues with your Windows installation by missing or corrupted system files. However, if the SFC tool can’t handle the issue, you can use DISM to repair images and system files on Windows 11.

Even if your system fails to boot, you can repair it with a series of DISM commands from the Windows Recovery Environment. In this guide, we will show you how to use DISM Commands to various issues in Windows 11.

Run DISM Commands to Restore Corrupted Files

DISM first scans your computer for corrupted or missing files associated with different Windows services. After that, it will download the required images and files from the Microsoft server and replace the corrupt files. For this to work, you will need an active internet connection.

To run this tool, you first need to launch Command Prompt with administrative privileges. Then, type the following commands one after the other and press Enter for each command:

ScanHealth: This switch scans your system’s component store for corrupted files and stores the record in the C:\Windows\Logs\CBS\CBS.log. But this command does not fix the issues. To scan for file corruption, enter the following command and press Enter:

DISM /Online /Cleanup-image /Scanhealth

DISM is not case-sensitive, you can write it however you want it (DISM, dism, Dism, etc.).

CheckHealth: After the first command finishes the scan, enter this command. The CheckHealth argument verifies if any corruption has been detected in your system files by checking the existing error logs. This command will also let you know whether the image is healthy, repairable, or non-repairable: Enter the below command to check the image’s health:

DISM /Online /Cleanup-Image /CheckHealth

The checkup process will take 10-15 minutes to complete. Once it’s done, you will see one of the following messages:

  • No component store corruption detected – It means the DISM scan hasn’t found any corruption or errors in the system files and no need to run the next command.
  • The component store is repairable – It means some Component Store corruption has been detected and can be fixed with the /RestoreHealth argument.
  • The component store is not repairable – If you get this, the following DISM command cannot fix the Windows Component Store corruption. You will have to try some other troubleshooting method to fix the error such as restoring Windows from a backup, resetting, or completely reinstalling your Windows.

RestoreHealth: This final argument repairs the corrupted files and stores the corruption records to C:\Windows\Logs\CBS\CBS.log. To restore the health of the system image, enter this command:

DISM /Online /Cleanup-Image /RestoreHealth

Then, wait for the process to finish which will take 10-15 minutes depending upon the corruption. If the corrupted files are repaired you will see the ‘The restore operation completed successfully.

Don’t interrupt the process until it is done. After the process is completed, restart your PC and see if the problem is resolved or not.

In case you want to check the log files to get a more detailed report of the DISM scan and repair, enter the following path in the File Explorer’s address bar and hit Enter:

C:\Windows\Logs\DISM\dism.log

or

C:\Windows\Logs\CBS\CBS.log 

Or, you open the Run command and type one of the commands to open the log report:

%windir%/Logs/CBS/CBS.log

or

%windir%\Logs\DISM\dism.log

If you see the “Windows Resource Protection detected corrupted files and successfully restored them.” message, it means DISM has found and fixed the corrupted files. You can then restart your PC and see if the problem is resolved.

Repair Windows Image with PowerShell

You can also use Windows PowerShell to repair Windows Component Store because the PowerShell version in Windows 11 and DISM commands has a similar cmdlet. To repair the Windows image with PowerShell, follow these steps:

To start with launch PowerShell with administrative privileges. Search for ‘PowerShell’ in the Windows search and right-click the top result and select ‘Run as administrator’.

Check Windows Image:

Type the following command and hit Enter to check the Windows Component store for corruption:

Repair-WindowsImage -Online –CheckHealth

This command quickly checks if there’s any corruption that exists in your system image but it doesn’t fix anything.

If your see ‘ImageHealthState: Healthy’ on the scan report, it means no errors were found in the component store.

Scan Windows Image:

If you see the ‘ImageHealthState’ as ‘Repairable’, it means you need to run the below command to scan the image:

Repair-WindowsImage -Online –ScanHealth

The above command doesn’t fix anything, it only finds corruption and saves the details in the log file (C:\Windows\Logs\DISM\dism.log).

Repair Windows Image:

After the scan is finished, type the following command in the elevated PowerShell window and hit Enter:

Repair-WindowsImage -Online –RestoreHealth

This command checks for corruption and if it encounters any, it will automatically repair it.

If you don’t have internet, you can use the ‘Source’ option with ‘install.wim/install.esd’ to restore the system components. You can run the DISM command offline from the local Windows image file (install.wim/install.esd). To do that, execute the following command:

Repair-WindowsImage -Online -RestoreHealth -Source G:\sources\install.wim:6 -LimitAccess

Where you need to specify the Windows version index in the .esd/.wim file.

Repair Windows Image using install.esd/.wim Image Offline

If you don’t have internet access or DISM finds problems replacing the damaged files, you will need to provide another Windows image using bootable install media, or a Windows 11 ISO file. You can use the ‘install.wim’ or ‘install.esd’ file from bootable install media or mounted Windows 11 ISO file to run DISM offline.

Create Windows 11 Bootable USB Drive or Mount the Windows 11 ISO

To start with, you need to download a fresh copy of Windows 11 using the Media Creation Tool. Here’s how you can create a bootable Windows USB drive:

Go to the official Windows 11 download page and click the ‘Download now’ button under the ‘Create Windows 11 Installation Media’ section.

Then, choose a destination folder and click ‘Save’.

After that, double-click on the ‘MediaCreationToolW11.exe’ tool to run the setup. If you see the User Account Control prompt, click ‘Yes’.

After that, click the ‘Accept’ button to accept the license terms.

On the next window, click ‘Next’ if you want to continue with the default language (English (United States)) and edition. If you want to change the language and edition, uncheck the ‘Use the recommended options for this PC’ option and then select language and edition from the drop-down menus.

Next, choose ‘USB flash drive’ to create USB installation media. or, choose ‘ISO file’ if you want to burn the ISO to a DVD later or mount the image.

In case you choose the ‘ISO file’ as the media option, you can save the Windows 11 ISO file on your local drive. Then, double-click on the downloaded ISO file to mount the image.

Select the USB flash drive from the list of drives and click ‘Next’.

This will create a Windows installation media that you can use to run the DISM tool.

Repair Windows 11 Recovery Image using install.esd/wim

Now, you can run Deployment Image Servicing and Management tool (DISM) with the alternate source (install.esd/wim) image from the Installation media to repair the local image.

Open Command Prompt in elevated mode. Then, copy-paste the below command and press Enter to repair the Windows 11 image.

DISM /Online /Cleanup-Image /RestoreHealth /Source:N:\Sources\install.esd

or

DISM /Online /Cleanup-Image /RestoreHealth /Source:N:\Sources\install.wim

Here, replace the Source Drive letter (N: with the path to the location of the install.esd/install.wim file) with the ISO mount point or the bootable USB drive in File Explorer. If you have mounted image or bootable USB, you can just use their drive letter here.

To limit the use of Windows updates by DISM, follow these steps:

The install.esd/install.wim may contain multiple editions within the same image. So, first, you need to figure out the index number corresponding to the Windows 11 edition you have installed on your computer. To do that, enter the below command:

dism /get-wiminfo /wimfile:N:\sources\install.esd

or

dism /get-wiminfo /wimfile:N:\sources\install.wim

Now, note down the index number for the Windows edition you installed on your computer.

Now, execute the below command:

Syntax:

dism /Online /Cleanup-Image /RestoreHealth /Source:wim:<Drive Letter>:\sources\install.wim:<Index Number> /limitaccess

Here, replace <Drive Letter> and <Index> with the appropriate values.

Example:

DISM /Online /Cleanup-Image /RestoreHealth /Source:esd:N:\Sources\install.esd:6 /LimitAccess

or

DISM /Online /Cleanup-Image /RestoreHealth /Source:wim:N:\Sources\install.wim:6 /LimitAccess

The /LimitAccess argument here prevents DISM from contacting Windows Update.

You can also use this command to repair the Windows image offline:

Dism /Image:C:\ /Cleanup-Image /RestoreHealth /Source:N:\Sources\install.esd

Where change N:\Sources\install.esd with the path to the Windows 11 image and C: with the root directory or system directory of Window.

Using DISM to Install Windows Updates

Windows update service doesn’t always work properly, at times, it fails to start, disabled, or crashes on a particular update. Moreover, Windows update only installs the latest available updates, it doesn’t allow you to install a particular update on your system. In such cases, you can use the built-in DISM to manually install specific Windows 11 updates.

First, visit the Microsoft Update Catalog repository and download the required updates (Critical Updates, Security Updates, and updates) from the list. If you already know the Microsoft Knowledge Base ID number ( e.g. KB5014019) for the update you want, you search for it in the search field in the top left corner.

Alternatively, you can just search for ‘Windows 11’ in the search field to get the list of all the available updates that have been released to the stable build.

Locate the update you wish to download from the list and click the ‘Download’ button corresponding to it.

This will open the download page with download links on a new window. Simply, click the link and choose a location in your local drive to save the file. The file type would be either ‘.cab’ or ‘.msu’ depending upon the type of update.

Adding a Windows Update Package to an Image

In the DISM command, you can use the /Add-Package switch to add a Windows update to the Window image. The syntax of the command is as follows:

Dism /Add-Package /PackagePath:<path_to_cabfile> [/IgnoreCheck] [/PreventPending]

Example:

To add an update package to a running Windows installation, use the below command:

Dism /Online /Add-Package /PackagePath="C:\Users\rajst\OneDrive\Documents\New folder\windows10.0-kb5014039-x64_045d1b25ac6d875123db6de219e056f5dac11295.cab"  /LogPath=C:\mount\dism.log

In the above command, replaceC:\Users\rajst\OneDrive\Documents\New folder\windows10.0-kb5014039-x64_045d1b25ac6d875123db6de219e056f5dac11295.cab with the downloaded update file name and its location.

To add multiple updates to the Windows Installation:

Dism /Online /Add-Package /PackagePath="C:\Users\rajst\OneDrive\Documents\New folder\windows10.0-kb5014039-x64_045d1b25ac6d875123db6de219e056f5dac11295.cab" /PackagePath="C:\Users\rajst\OneDrive\Documents\New folder\windows10.0-kb5013943-arm64_d5a0aeff704eefab25f8674d8c01e01d476ff0b9.msu" /PackagePath="C:\Users\rajst\OneDrive\Documents\New folder\windows10.0-kb5012678-x64_b6e01cb1801810d1581e29dede0e48f635521e44.cab"/LogPath=C:\mount\dism.log

After installing the updates, you can check if the added packages appear in the list of packages in your system:

Dism /online /Get-Packages

Remove Windows Updates using the DISM tool

You can also remove an installed Windows update using the DISM tool from either the Command Prompt or the Windows recovery environment. In case, you encounter an error or Windows fails to boot, you can use this method to remove the recently installed updates from Windows 11 PC.

Open Command Prompt with administrative privileges. Then, run the below command to view the list of all the recently installed packages and updates on your computer:

DISM /Online /get-packages /format:table

From the Package Identity column, look for the package name of the update that you want to uninstall. You can also confirm the package you want to remove with the install time and date.

To get more details about the particular package or update, try the below command:

DISM /online /get-packageinfo /packagename:PackageName

For example:

DISM /online /get-packageinfo /packagename:Package_for_ServicingStack_1011~31bf3856ad364e35~amd64~~25145.1011.1.0

The syntax for removing the update package:

DISM /Online /Remove-Package /PackageName:PackageName

For example, to uninstall the update name ‘Package_for_ServicingStack_1011~31bf3856ad364e35~amd64~~25145.1011.1.0’, run the below command:

DISM /Online /Remove-Package /PackageName:Package_for_ServicingStack_1011~31bf3856ad364e35~amd64~~25145.1011.1.0

Enable or Disable Windows Features Using DISM

With DISM, you can also enable or disable Windows features offline on a .wim or .vhd file (mounted ISO), or online on a running operating system. Here’s how you can do that:

First, open Command Prompt with administrative privileges. Now, list all the available features in your Windows 11 with the following command:

DISM /online /Get-Features

From the list of features locate the features you want to enable or diable.

Once you locate a particular feature, you can get more details about that feature with the /Get-FeatureInfo switch. For example:

DISM /online /Get-FeatureInfo /FeatureName:TelnetClient

Enable Windows 11 features using DISM

If you want to enable a specific feature in Windows 11, you can use the Enable-Feature argument:

DISM /online /Enable-Feature /FeatureName:TelnetClient /All

If you want to enable a feature in a mounted image offline, you need to specify the mounted directory using the /image argument.

DISM /Image:D:\Win11OS\offline /Enable-Feature /FeatureName:TelnetClient /All

In the above example, replace D:\Win11OS\offline with the location of the mounted image.

After enabling the feature, you can use the ‘Get-FeatureInfo’ to find the status of the feature.

DISM /online /Get-FeatureInfo /FeatureName:TelnetClient

If you specify multiple /Source options, the DISM uses the files from the first source argument and the rest of the locations are ignored:

Dism /Online /Enable-Feature /FeatureName:TelnetClient /Source:N:\sources\SxS /Source:C:\test\mount\windows /LimitAccess 

Disable Windows 11 Features using DISM

In case you want to disable a particular feature from the operating system, use the following command:

DISM /online /Disable-Feature /FeatureName:TelnetClient

If you want to disable a feature in a mounted image offline, you need to specify the mounted directory using the /image argument.

DISM /Image:D:\Win11OS\offline /Disable-Feature /FeatureName:TelnetClient

In the above example, replace D:\Win11OS\offline with the location of the mounted image.

Remove Windows 11 features using DISM

If you want to remove the specific feature from the Windows installation without having to delete the feature from the image. To do this, enter the below command:

DISM /online /Disable-Feature /FeatureName:TelnetClient /Remove

If you want to remove a feature in a mounted image offline, you need to specify the mounted directory using the /image argument:

DISM /Image:D:\Win11OS\offline /Disable-Feature /FeatureName:TelnetClient /Remove

DISM failed Error on Windows 11

When running the DISM command on Windows 11, you may face many problems. Here are some of the most common issues reported by the users:

  • DISM failed no operation was performed – This is one of the most common errors you will get when using /restorehealth argument. It can be fixed by ruining DISM with the Windows 11 ISO file.
  • DISM failed 0x8000ffff, 0x800f0954, 0x800f0950, 0x800f0906, 0x800f081f (The source files could not be found. Use the “Source” option to specify the location of the files that are required to restore the feature.) – This is another common error you will get from DISM operation which is usually caused by no direct Internet access or Windows Update service is disabled/failed. In that cases, use a bootable USB flash drive, ISO image, or install.wim (esd) file with the Windows installation image to perform the DISM scan.
  • DISM failed while processing command cleanup-image, add-package – This issue can be fixed by cleaning up the system image components with /StartComponentCleanup switch or resetting the Windows update service.
  • DISM failure when attempting to copy boot files – This is a common DISM problem that can be fixed by cleaning up the system image component with /StartComponentCleanup switch.
  • Dism.exe failed validating command line, to load wim manager – If you are having this issue, it can be fixed by restarting the Windows update components.
  • DISM failed to load the provider, to unload offline registry, to flush file buffers, to set the windows directory, mount the image – These issues can be fixed by checking your antivirus, cleaning up the system image component, resetting Windows Update Service, or copying and specifying the correct location of the Install.wim file.

DISM Commands Not Working on Windows 11?

There are several reasons for DISM not working and showing you the above list of errors on Windows 11. You can fix most of these issues using the following methods.

Clean up the Components Store

Most of the DISM issues are caused by the corruption in System Image Components and it can be fixed by analyzing and cleaning up the system component store. DISM has a set of commands to refresh the DISM tool.

First, you need to analyze the component store with /AnalyzeComponentStore argument in the DISM argument.

To analyze the component store run the following command:

DiSM /Online /Cleanup-Image /AnalyzeComponentStore

Wait for the process to be over, then you will see something similar to the following information:

  • Windows Explorer Reported Size of Component Store : 7.48 GB.
  • Actual size of component : 7.45 GB
  • Date of the Last Cleanup: 2022-06-12: 23:13:57.
  • Number of Reclaimable Packages: 0.
  • Component Store Cleanup Recommended: Yes or No.

If the ‘Component Store Cleanup Recommended’ is ‘Yes’, then you need to proceed with the cleanup operation.

To run the component cleanup, enter the following command:

DISM /Online /Cleanup-Image /StartComponentCleanup

This command will remove all the outdated files or previous versions of the updated components from the components store.

If the above command doesn’t fix your issue, then use the /ResetBase argument to reset the component store size and reduce its size. To do that, use the below command:

DISM /Online /Cleanup-Image /StartComponentCleanup /ResetBase

Alternatively, you use /Defer switch to post-pone or schedule the cleanup operations to the next automatic system maintenance.

DiISM /Online /Cleanup-Image /StartComponentCleanup /ResetBase /Defer

To revert all pending DISM tasks including Windows Updates, run the following command:

DISM.exe /image:C: /cleanup-image /revertpendingactions

Run CHKDSK

If you are having disk-related issues with the DISM, run the following command in the Command Prompt in administrator mode:

chkdsk /offlinescanandfix

Since your system currently using the C drive, it will ask you whether to schedule the scan the next time the system restarts. Type ‘Y’ and press Enter.

Then, restart your PC to run chkdsk scan.

Reset Windows Update Service

DISM uses Windows Update Service to download and repair or replace corrupted files in the Windows image. If the Windows Update service fails to start or not working properly, you can try resetting the Windows update service.

First, launch Command Prompt with administrative privileges. In the Command Prompt window, input the below command and hit Enter.

net stop wuauserv

Wait for the process to complete and then enter the following commands one after the others:

cd %systemroot%SoftwareDistribution
ren Download Download.old
net start wuauserv
net stop bits
net start bits
net stop cryptsvc
cd %systemroot%system32
ren catroot2 catroot2old
net start cryptsvc

After successfully completing the commands, the Windows Update service will be restarted and the DISM issue will be fixed.

Disable Proxy Service

If DISM fails to connect to the internet or run on your system, it might be due to proxy configuration on your PC. To resolve this issue, you need to disable the proxy on your device.

First, open Windows Settings by pressing Win+I shortcuts. In the Settings app, go to the ‘Network & internet’ section on the left and click on the ‘Proxy’ option on the right.

On the Proxy settings page, turn off all the settings under the ‘Automatic proxy setup’ and ‘Manual proxy setup’.

Changing the Startup Type of the Remote Procedure Call (RPC) service

If you see a DISM failed 1726 error, it is probably caused when the Remote Procedure Call (RPC) service is disabled or failed to start automatically.

Remote Procedure Call (RPC) is an interprocess communication protocol or technique that allows a program to request services from another program located in another computer on a network as if it is a local system. It is responsible for structuring distributed, client-server-based applications. 

It is a Service Control Manager for Component Object Model (COM) and the Distributed Component Object Model (DCOM) servers. If this communication protocol is disabled, then all the services and applications that depend on the COM and DCOM (like DISM) will not work properly. Here’s how you can change the startup method for RPC and make sure it is running properly:

First, press Windows+R keys simultaneously to launch the Run dialogue box. Then, type ‘services.msc’ in the text field and hit Enter.

Alternatively, you can just search for ‘services’ in the Windows search and open the top result.

In the Services window, scroll down and locate the service named ‘Remote Procedure Call’. There will be two services named Remote Procedure Call – Remote Procedure Call (RPC) and Remote Procedure Call (RPC) Locator.

Now, right-click the ‘Remote Procedure Call (RPC)’ service and select ‘Properties’ or just double-click on it.

Under the General tab of the Properties window, click the drop-down menu next to ‘Startup’ type and change it to ‘Automatic’. Then, click ‘Apply and then ‘OK’.

This will automatically start the RPC service when you start your system and fix the DISM 1726 error.

Also, double-click on the ‘Remote Procedure Call (RPC) Locater’ service and make sure its Startup type is set to ‘Manual’.

Then restart the computer to apply the changes. If you are still encountering the problem, try the next solution.

Modify the Value of the RpcSs Registry Key

If the DISM failed 1726 error is not resolved by the above method, you need to change the RpcSs registry value to fix the issue. Follow these instructions to edit the RpcSc registry key:

Open the Run command box by pressing Win+R simultaneously. Then, type ‘regedit’ and hit Enter. If you see the User Account Control (UAC) prompt box, click ‘Yes’.

Before we modify the registry, it is safe to backup your registry, so you can revert the changes if something goes wrong. To do this, click the ‘File’ menu and select ‘Export’.

Then, give a name for the backup file, choose whether you want to back up the whole registry or the selected branch in the registry (under Export range), and then select the destination folder. After that, click the ‘Save’ button.

After backing up the registry, navigate the following location or copy-paste the below path in the address field:

HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\RpcSs

In the right-side panel of the ‘RpcSc’ key, double-click on the ‘Start’ DWORD to edit it.

Now, set the ‘Value data’ of Start to 2 and press ‘OK’ to save the changes.

After that, close the registry editor and restart your PC to apply the changes.

Correct the Location of the Install.esd File

If you are encountering the “Cannot find source files” or “The system cannot find the path specified”, it means the location you specified for the Install.esd file in the Source option is incorrect.

Open elevated Command Prompt. Then enter the below command and hit Enter:

DISM /Online /Cleanup-Image /RestoreHealth /source:ESD:X:SourcesInstall.esd:2 /LimitAccess

In the above command make sure to replace X with the drive letter of the mounted ISO file or the drive letter of the bootable USB.

Temporarily Disable Windows Search Service

If you are encountering DISM Error 87 or the remote procedure call failed error, disabling the Windows Search service while running the DISM command can help resolve the issue. Windows Search service is a search service that allows you to search for files and apps within the system. Follow these instructions to disable the Windows search service:

Open the Run command box (press Windows+R), type ‘services.msc’, and hit Enter to open the Services window.

In the Services window, scroll down to the ‘Windows search’ service, right-click on it and select ‘Properties’. Or you can just right-click on it.

Then, under the General tab, change the ‘Startup type’ to ‘Disabled’.

After that, click ‘Apply’ and then ‘OK’.

This will temporarily stop the Windows search services temporarily. You can disable the service whenever the error occurs, then re-enable it after the DISM commands are executed successfully.

Run DISM Command in Clean Boot Mode (Offline)

Sometimes DISM failure occurs due to conflicts of services that are running in the background. So, executing the DISM commands in a clean boot may prevent these problems. Here’s how you can run DISM commands in Clean boot mode:

First, open Windows Settings by right-clicking the Start menu and selecting ‘Settings’.

In the Settings app, go to the ‘System’ tab and click on the ‘Recovery’ option on the right pane.

On the Recovery page, click the ‘Restart now’ button on the Advanced startup tile under Recovery.

Click the ‘Restart now’ button again to restart your PC.

The windows will boot your system into Windows Recovery Environment.

If your computer is not booting properly for you access the above settings. You can use this alternative way to access the Windows Recovery Environment (WinRE).

Using Hard Reboot

First, shut down your PC or turn off your PC and then press the power button to turn on the system. And just when Windows starts loading, press and hold the power button to force shutdown your PC.

Repeat these steps two or three times and the fourth time let Windows load normally. It will automatically boot into Windows Recovery Environment (WinRE). When the automatic repair screen appears, click ‘Advanced Options’.

Then select the ‘Troubleshoot’ option in the Choose an option screen.

On the next screen, choose ‘Advanced options’.

On the Advanced options screen, select the ‘Command Prompt’ option.

The Command Prompt will start with X:\Windows \System32 which is not Windows installation location. You need to find out where Windows is installed using diskpart command.

First, type diskpart to manage drives.

Next, enter list volume to get a list of all the volumes or drives connected to your system. Then, find the volume or drive in which Windows is installed. The Windows drive (which would have a different drive letter instead of C) will have no name or label. Also, you can locate the Windows drive by its size if you already know it. Note down the Windows drive letter from this list.

In the below screen, Volum 3 ‘F’ is the Windows drive. Now, note down the Windows drive letter that we are going to use to run DISM commands.

After that type exit to leave diskpart.

Then, enter the below command to run DISM scan in clean boot:

DISM /image:F:\ /cleanup-image /restorehealth

If you are booting from a Windows installation media or have a Windows 11 iso file connected to your computer on a bootable drive, you can use the following DISM command to repair the Windows image offline:

Dism /image:F:\ /Cleanup-Image /RestoreHealth /Source:N:\sources\install.esd

or

Dism /image:F:\ /Cleanup-Image /RestoreHealth /Source:N:\sources\install.wim

Where F: is the Windows 11 drive and N: is where we have the Windows installation media.

In case you don’t have enough space on the selected drive, you will need to specify an empty directory on a separate drive to perform the repair operation. To do that follow these steps:

First, create a folder named ‘scratch’ on that separate drive. You can also use the mkdir G:\scratch to create the folder.

Then, enter the below command to repair the component store using the ScratchDir:

Dism /image:F:\ /Cleanup-Image /RestoreHealth /Source:N:\sources\install.esd /ScratchDir:G:\scratch

Here, we specified the scratch directory location using the /ScratchDir switch. Wait for the repair operation to finish, then restart your PC.

Copy-Paste install.wim/esd (from the boot drive to the local C: drive)

If the DISM cannot access the install.wim/esd file from the Windows bootable drive or installation disc, you can copy install.wim/esd file from to the local C: drive.

First, insert the Windows 11 bootable drive or the installation disc into your PC. Alternatively, you can also mount the Windows ISO file and create a boot drive.

Then, find the install.esd/wim file from the installation files and copy it with Ctrl+C. It is probably located inside the Source directory of the installation files.

Next, paste the copied files inside the ‘local C:’ drive (system drive) by pressing Ctrl+V. You don’t have to paste the file in any particular folder just inside the C: drive.

After that open Command Prompt with administrative privileges.

Then, enter the below command in the command prompt to repair Windows:

DISM /Online /Cleanup-Image /RestoreHealth /source:WIM:C:\Install.wim:1 /LimitAccess

Disable Read-Only Option in Install.esd

Sometimes, the Install.esd may not work, even after copying it to the local C drive. In such cases, make sure the Install.esd or Install.wim file is not in read-only mode. Here’s how you do this:

On the File Explorer, navigate to the Install.esd file on your system. Then, right-click on the file and select ‘Properties’.

Then, uncheck the ‘Read-only’ option next to Attributes, click ‘Apply’, and then ‘OK’.

Repair Windows Image Using Cleanup-MountPoints Argument

Sometimes, when altering the Windows image with DISM, the image can get corrupted. It can be easily fixed by cleaning up the mount points of your image.

Use the /Cleanup-MountPoints option with DISM as shown below:

Dism /Cleanup-Mountpoints

That’s it.