PMs

The Correct Order:
  1. DISM.exe /Online /Cleanup-Image /RestoreHealth (Always run this first to fix the underlying Windows update files).
  2. sfc /scannow (Run this second so it can use those fixed files to repair your actual operating system).
  3. chkdsk C: /f /scan (Run this third to clean up the file system structure after files have been modified).
  4. defrag D: /D /U /V (for raid drives)
  5. defrag D: /X /U /V (for regular drives)
  6. defrag C: /O (Run this last to optimize the drive blocks and TRIM the free space after all repairs are complete).