I want to initially check for DISM health, then based on result, I want to select 1 (to run DISM restore & sfc) or 2 (run only sfc).
I cannot get this to work. Any guidance would be appreciated.
Edit: Maybe there's a way to do this all automatically? Execute choice based on initial result?
@ECHO OFF
:BEGIN
CLS
Dism /Online /Cleanup-Image /CheckHealth
timeout /t -1
ECHO.
CHOICE /N /C:12 /M "Press '1' to Run DISM/RestoreHealth & SFC, or Press '2' to run only SFC"%1
ECHO.
IF ERRORLEVEL ==1 GOTO 1
IF ERRORLEVEL ==2 GOTO 2
GOTO END
:2
sfc/scannow
GOTO END
:1
Dism /Online /Cleanup-Image /RestoreHealth
sfc/scannow
:END
pause