Advertisement
slyfox1186

simple-dism-sfc-repair-windows.bat

Aug 8th, 2022
1,662
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Batch 1.44 KB | None | 0 0
  1. @ECHO OFF
  2. SETLOCAL ENABLEEXTENSIONS
  3. COLOR 0A
  4. TITLE SIMPLE DISM AND SFC REPAIR
  5.  
  6. :----------------------------------------------------------------------------------
  7.  
  8. REM USE THIS TO FIX AND REPAIR CORRUPTED WINDOWS 10 AND 11 IMAGES
  9.  
  10. :----------------------------------------------------------------------------------
  11.  
  12. IF NOT "%1"=="MAX" START /MAX CMD /D /C %0 MAX & GOTO :EOF
  13.  
  14. :----------------------------------------------------------------------------------
  15.  
  16. TASKLIST | FINDSTR "Dism.exe TiWorker.exe" >NUL && TASKKILL /F /IM "Dism.exe" /IM "TiWorker.exe" /T >NUL 2>&1
  17.  
  18. :----------------------------------------------------------------------------------
  19.  
  20. ECHO DISM ^& SFC & ECHO=
  21. ECHO [1] NO RESTART
  22. ECHO [2] RESTART PC
  23. ECHO [3] EXIT & ECHO=
  24.  
  25. CHOICE /C 123 /N & CLS
  26.  
  27. :----------------------------------------------------------------------------------
  28.  
  29. IF ERRORLEVEL 3 GOTO :EOF
  30. IF ERRORLEVEL 2 SET "FLAG=A" & GOTO RUNTHIS
  31. IF ERRORLEVEL 1 CLS
  32.  
  33. :----------------------------------------------------------------------------------
  34.  
  35. :RUNTHIS
  36. DISM /Online /Cleanup-Image /RestoreHealth /StartComponentCleanup
  37. ECHO=
  38. DISM /Online /Cleanup-Image /RestoreHealth
  39. ECHO=
  40. SFC /SCANNOW
  41. ECHO=
  42. SFC /SCANNOW
  43.  
  44. :----------------------------------------------------------------------------------
  45.  
  46. IF %FLAG%==A (
  47.     SHUTDOWN /R /T 1
  48.     GOTO :EOF
  49. )
  50.  
  51. :----------------------------------------------------------------------------------
  52.  
  53. ECHO=
  54. PAUSE
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement