CMD Commands to Repair Corrupted Files
Common DISM Commands (Online Image)
These commands are used to service the running operating system (online image).
1) Check the image health (quick scan):
DISM /Online /Cleanup-Image /CheckHealth
This command only reports if the image is marked as corrupted and if it is repairable, without attempting any fixes.
2) Scan the image health (advanced scan):
DISM /Online /Cleanup-Image /ScanHealth
This performs a more thorough scan for component store corruption and can take several minutes to hours.
3) Repair the image (automatically):
DISM /Online /Cleanup-Image /RestoreHealth
This command scans for and repairs common issues using files from Windows Update or a specified source.
4) Repair using a specific source:
DISM /Online /Cleanup-Image /RestoreHealth /Source:C:\RepairSource\Windows /LimitAccess
Use this if Windows Update is unavailable or corrupted, replacing C:\RepairSource\Windows with the path to a known good repair source (e.g., a mounted ISO or network share). /LimitAccess prevents DISM from using Windows Update as a backup source.
5) Run a System File Checker (SFC) scan (often used after DISM):
sfc /scannow
This command verifies and repairs protected Windows system files after the underlying image has been fixed by DISM.
Feature Management Commands
DISM can also list, enable, or disable Windows features.
List all available features:
DISM /Online /Get-Features
This command outputs a list of feature names and their current state (Enabled/Disabled).
Get information about a specific feature:
DISM /Online /Get-FeatureInfo /FeatureName:TFTP
Replace TFTP with the actual name of the feature you're interested in.
Enable a specific feature:
DISM /Online /Enable-Feature /FeatureName:TFTP /All
The /All option ensures all necessary parent features are enabled as well.
Disable a specific feature:
DISM /Online /Disable-Feature /FeatureName:TFTP