Skip to content

System Health and Repair Guide

This guide provides step-by-step instructions and terminal commands to diagnose and resolve system stability issues on Windows 11.

  1. Basic System Checks
  2. Disk Health and Repair
  3. System File Integrity
  4. Windows Update Troubleshooting
  5. Driver Management
  6. Performance Optimization
  7. Boot Configuration Repair
  8. Memory Diagnostics
  9. Application Troubleshooting
  10. Advanced Recovery Options

Generate a comprehensive system health report to identify issues:

Terminal window
perfmon /report

Assess overall system performance:

Terminal window
winsat formal
Terminal window
Get-EventLog -LogName System -EntryType Error -Newest 20 | Format-Table -AutoSize
Terminal window
Get-Service | Where-Object {$_.Status -eq "Running"} | Sort-Object DisplayName

Scan and repair disk errors (replace C: with relevant drive letter):

Terminal window
chkdsk C: /f /r

Parameters:

  • /f - Fixes errors on the disk
  • /r - Locates bad sectors and recovers readable information
Terminal window
Get-Volume
Terminal window
defrag C: /A /V

Parameters:

  • /A - Analyze only
  • /V - Verbose output

To perform actual optimization:

Terminal window
defrag C: /O /V
Terminal window
wmic diskdrive get status, caption, size

Scan and repair corrupted Windows system files:

Terminal window
sfc /scannow

Repair Windows image:

Terminal window
DISM /Online /Cleanup-Image /CheckHealth

For more detailed scanning:

Terminal window
DISM /Online /Cleanup-Image /ScanHealth

To restore health:

Terminal window
DISM /Online /Cleanup-Image /RestoreHealth

Check the Windows Component Store for corruption:

Terminal window
DISM /Online /Cleanup-Image /AnalyzeComponentStore

Reduce component store size:

Terminal window
DISM /Online /Cleanup-Image /StartComponentCleanup

For deeper cleanup (may take longer):

Terminal window
DISM /Online /Cleanup-Image /StartComponentCleanup /ResetBase
Terminal window
net stop wuauserv
net stop cryptSvc
net stop bits
net stop msiserver
ren C:\Windows\SoftwareDistribution SoftwareDistribution.old
ren C:\Windows\System32\catroot2 catroot2.old
net start wuauserv
net start cryptSvc
net start bits
net start msiserver

Run Windows Update Troubleshooter from Command Line

Section titled “Run Windows Update Troubleshooter from Command Line”
Terminal window
msdt.exe /id WindowsUpdateDiagnostic
Terminal window
UsoClient StartScan
UsoClient StartDownload
UsoClient StartInstall
Terminal window
pnputil /enum-drivers
Terminal window
Get-PnpDevice | Group-Object Status | Format-Table Name, Count

Update Drivers via PowerShell (requires admin rights)

Section titled “Update Drivers via PowerShell (requires admin rights)”
Terminal window
winget upgrade --all
Terminal window
pnputil /export-drivers /path C:\Drivers
Terminal window
Remove-Item $env:TEMP\* -Recurse -Force -ErrorAction SilentlyContinue
Terminal window
Get-CimInstance Win32_StartupCommand | Select-Object Name, Location, Command | Format-Table -AutoSize

To manage startup items graphically:

Terminal window
msconfig
Terminal window
Get-Process | Sort-Object -Property CPU -Descending | Select-Object -First 10
Terminal window
ipconfig /flushdns
Terminal window
netsh winsock reset
netsh int ip reset
Terminal window
bootrec /FixMbr
bootrec /FixBoot
bootrec /ScanOs
bootrec /RebuildBcd
Terminal window
bcdboot C:\Windows /s C: /f ALL
Terminal window
bcdedit /enum
Terminal window
mdsched.exe
Terminal window
Get-CimInstance -ClassName Win32_OperatingSystem | Select-Object FreePhysicalMemory, TotalVisibleMemorySize

Clear Memory Standby List (frees up cached memory)

Section titled “Clear Memory Standby List (frees up cached memory)”
Terminal window
Clear-StandbyList
Terminal window
Get-AppXPackage -AllUsers | Foreach {Add-AppxPackage -DisableDevelopmentMode -Register "$($_.InstallLocation)\AppXManifest.xml"}
Terminal window
wsreset.exe
Terminal window
appwiz.cpl
Terminal window
Get-AppxPackage -PackageTypeFilter Bundle | Format-Table Name, Status, InstallLocation
Terminal window
Checkpoint-Computer -Description "Manual Restore Point" -RestorePointType "MODIFY_SETTINGS"
Terminal window
shutdown /r /o /f /t 00
Terminal window
msdt.exe /id MaintenanceDiagnostic
Terminal window
systemreset --keepmyfiles

For this option, you’ll need to:

  1. Download the Windows 11 installation media
  2. Run setup.exe from the media
  3. Choose “Upgrade this PC now”
  4. Select “Keep personal files and apps”

Additional Tips for Improved System Performance

Section titled “Additional Tips for Improved System Performance”
  1. Regularly update Windows, drivers, and applications
  2. Uninstall unused applications
  3. Disable visual effects (System Properties > Advanced > Performance Settings)
  4. Ensure adequate disk space is available (at least 15% free space)
  5. Check for malware using Windows Security or third-party tools
  6. Monitor system temperature to prevent thermal throttling
  7. Consider hardware upgrades if system consistently struggles with performance

These commands and procedures should help diagnose and resolve most Windows 11 stability issues. Always ensure you have backed up important data before performing system repairs.