Remember to maintain security and privacy. Do not share sensitive information. Procedimento.com.br may make mistakes. Verify important information. Termo de Responsabilidade

Using DISM to Check and Repair Windows Image

The Deployment Image Servicing and Management (DISM) tool is a powerful command-line utility that allows system administrators and users to check and repair the integrity of the Windows operating system image. When Windows becomes unstable, fails to boot, or experiences errors related to built-in applications or services, running DISM can often resolve these issues.

This guide will walk you through using the SFC (System File Checker) and DISM commands, including sfc /scannow, DISM /Online /Cleanup-Image /RestoreHealth, and Repair-WindowsImage -Online -RestoreHealth (PowerShell) to diagnose and fix Windows image corruption. These commands are applicable to Windows 10, Windows 11, and Windows Server 2022/2019/2016.


1. Using System File Checker (SFC) to Repair Windows System Files

Before using DISM, it's recommended to run System File Checker (SFC) to check for corrupted system files and attempt repairs.

Run SFC Command

  1. Open an elevated Command Prompt (Run cmd as Administrator).
  2. Execute the command:
    sfc /scannow
  3. Wait for the scan to complete. Possible results include:
    • No integrity violations found → No corruption detected.
    • Found corrupt files and successfully repaired them → Issue resolved.
    • Found corrupt files but was unable to fix some of them → Use DISM to repair the system.

Extract SFC Scan Log

If SFC reports errors but cannot fix them, extract relevant log details:

findstr /c:"[SR]" %windir%\Logs\CBS\CBS.log > "%userprofile%\Desktop\sfc.txt"

This saves the SFC-related logs to a file called sfc.txt on your desktop.


2. Check Windows Component Store Health Using DISM

The Windows Component Store (WinSxS folder) stores system files required for system repairs. If this store is corrupted, it may cause system instability.

Run DISM Health Check

  1. Open Command Prompt as Administrator.
  2. Run the following command to check for corruption:
    DISM /Online /Cleanup-Image /CheckHealth
    • If no corruption is found, no further action is needed.
    • If corruption is detected, proceed with ScanHealth.

Perform a Full Component Store Scan

DISM /Online /Cleanup-Image /ScanHealth

This process can take 10-30 minutes and may return one of these results:

  • No component store corruption detected → No issues found.
  • The component store is repairable → Continue with RestoreHealth.
  • The component store is not repairable → Requires a full Windows reinstallation or recovery.

3. Repair Windows Image Using DISM /RestoreHealth

If corruption is found, run the RestoreHealth command to repair the Windows image.

Standard Repair Using Windows Update

DISM /Online /Cleanup-Image /RestoreHealth
  • This command downloads missing/corrupted files from Windows Update.
  • Requires an active internet connection.

Common DISM Errors

If the restore operation fails, you may see errors such as:

  • 0x800f081f – The source files could not be found.
  • 0x800f0906 – The source files could not be downloaded.
  • 0x800F0950 – No operation was performed.

Using a Local Installation Source

If you don't have internet access or Windows Update is unavailable, use a local Windows installation ISO or WIM/ESD file.

  1. Check Windows Version

    Get-ComputerInfo | select WindowsProductName,WindowsEditionId,WindowsVersion,OSDisplayVersion
  2. List Available Windows Editions in WIM File

    Get-WindowsImage -ImagePath "D:\sources\install.wim"
    • Note the ImageIndex of your Windows edition.
  3. Run DISM with Local Source

    DISM /Online /Cleanup-Image /RestoreHealth /Source:WIM:D:\sources\install.wim:6 /LimitAccess
    • Replace D: with the drive letter of your Windows installation media.
    • The index number (6 in this case) should match your Windows edition.

If using an ESD file:

DISM /Online /Cleanup-Image /RestoreHealth /Source:ESD:D:\sources\install.esd:6 /LimitAccess

4. Repair Windows Image Using PowerShell

In Windows 10/11 and Windows Server 2016+, PowerShell offers an equivalent command.

Check Windows Image Health

Repair-WindowsImage -Online -ScanHealth

Repair Component Store

Repair-WindowsImage -Online -RestoreHealth

If using a local WIM file, specify the source:

Repair-WindowsImage -Online -RestoreHealth -Source F:\sources\install.wim:5 -LimitAccess

5. Use DISM Offline to Repair Windows Image

If Windows fails to boot, use DISM in offline mode.

Steps:

  1. Boot from a Windows installation USB/DVD.
  2. Open Command Prompt (Shift + F10).
  3. Identify drive letters (your system partition may not be C:):
    diskpart
    list volume
    exit
  4. Run SFC Offline:
    sfc /scannow /offbootdir=C:\ /offwindir=C:\Windows
  5. Run DISM Offline Using Installation Media:
    Dism /Image:C:\ /Cleanup-Image /RestoreHealth /Source:D:\sources\install.wim
    • Replace C:\ with your Windows partition.
    • Replace D:\ with your installation media drive.

Use a Temporary Directory for Repairs

If the target drive has insufficient space, specify a scratch directory:

Dism /Image:C:\ /Cleanup-Image /RestoreHealth /Source:D:\sources\install.wim /ScratchDir:F:\scratch

6. Additional Useful DISM Commands

Command Description
DISM /Add-Package Installs MSU/CAB updates.
DISM /Get-Drivers Lists installed drivers.
DISM /Add-Driver Injects drivers into Windows image.
DISM /Enable-Feature /Disable-Feature Manages Windows features.
DISM /StartComponentCleanup Cleans up the Component Store (WinSxS).
DISM /Set-Edition Upgrades Windows from evaluation to full version.

Conclusion

Using DISM and SFC together allows you to diagnose and repair Windows system file corruption efficiently. If your system remains unstable even after these repairs, consider restoring from a backup or reinstalling Windows.

To share Download PDF

Gostou do artigo? Deixe sua avaliação!
Sua opinião é muito importante para nós. Clique em um dos botões abaixo para nos dizer o que achou deste conteúdo.