Code: Select all
dism.exe /online /cleanup-image /checkhealth
dism.exe /online /cleanup-image /scanhealth
dism.exe /online /cleanup-image /restorehealth
sfc /scannow
dism.exe /online /cleanup-image /AnalyzeComponentStore
dism.exe /online /cleanup-image /StartComponentCleanup
if not exist D:\$RECYCLE.BIN goto step2
echo y|chkdsk /f D:
:Step2
if not exist H:\$RECYCLE.BIN goto step3
echo y|chkdsk /f H:
:Step3
if not exist M:\$RECYCLE.BIN goto step4
echo y|chkdsk /f M:
:Step4
if not exist P:\$RECYCLE.BIN goto step5
echo y|chkdsk /f P:
:Step5
if not exist V:\$RECYCLE.BIN goto step6
echo y|chkdsk /f V:
:Step6
chkdsk.exe c:
if ERRORLEVEL 2 goto ADD_CHECK
echo.
echo The drive is okay this time.
goto end
:ADD_CHECK
reg ADD "HKLM\SYSTEM\CurrentControlSet\Control\Session Manager" /v BootExecute /t REG_MULTI_SZ /d "autocheck autochk /p \??\C:\0autocheck autochk *" /f
echo.
echo The C drive has problems Please run chkdsk next boot
pause
:end