Jan 04

简而言之如果你的 Windows 10 是 10.0.19042.685 版本(既 20H2)并且安装在固态硬盘上,在升级 KB4592438 后如果运行过 CHKDSK C: /F ,则有极大几率出现系统重启后蓝屏无法进入系统的现象!

解决办法就是进入恢复模式或者 PE,重新执行 CHKDSK C: /F,然后重启。

进阶脚本,特别适配了 Windows 10 新一代的 CHKDSK 参数:

ScanDisk.bat C: D: E: ... (指定扫描修复,最多接 9 个盘符)

:: BatchGotAdmin 
:-------------------------------------
@echo off
REM  --> Check for permissions
>nul 2>&1 "%SYSTEMROOT%system32cacls.exe" "%SYSTEMROOT%system32configsystem"

REM --> If error flag set, we do not have admin.
if '%errorlevel%' NEQ '0' (
    echo Requesting administrative privileges...
    goto UACPrompt
) else ( goto gotAdmin )

:UACPrompt
    echo Set UAC = CreateObject^("Shell.Application"^) > "%temp%getadmin.vbs"
    echo UAC.ShellExecute "%~s0", "", "", "runas", 1 >> "%temp%getadmin.vbs"

    "%temp%getadmin.vbs"
    exit /B

:gotAdmin
    if exist "%temp%getadmin.vbs" ( del "%temp%getadmin.vbs" )
    pushd "%CD%"
    CD /D "%~dp0"
    @echo on
:--------------------------------------

:: WindowsVersionChecker (detect OS) 
:--------------------------------------
@ECHO off
REM https://msdn.microsoft.com/en-us/library/windows/desktop/ms724832.aspx
REM 10.0 -- Win 10, Win Server 2016 TP2
REM 6.4 -- Win 10 TP, Win Server 2016 TP1
REM 6.3 -- Win 8.1, Win Server 2012 R2
REM 6.2 -- Win 8, Win Server 2012
REM 6.1 -- Win 7, Win Server 2008 R2
REM 6.0 -- Win Vista, Win Server 2008
REM 5.2 -- Win Server 2003, Win Server 2003 R2, Win XP 64-Bit Edition
REM 5.1 -- Win XP
REM 5.0 -- Win 2000

FOR /f "tokens=4,5,6 delims=[]. " %%a IN ('ver') DO (
    SET WVer=%%a.%%b.%%c
    SET WMajor=%%a
    SET WMinor=%%b
    SET WRev=%%c
)
:--------------------------------------

:: ScanDisk All::PrintInfo  (c) 2015 BSD-Clause 3
:--------------------------------------
@echo off
echo.
echo == ScanDisk All ==
echo   (C) 2014-2015 "" BSD-Clause 3
echo.
echo   This program will run CHKDSK on selected drives in an unattended manner.
echo   CHKDSK will be done in a two-steps way for safer execution.
echo   Supports:
echo     * NTFS
echo     * New generation CKHDSK commands (/scan /perf ...)
echo     * Special treatment of SYSTEM drive (C: as default).
echo       - Includes "sfc /scannow" for check system files integrity.
echo.
echo   Notice that if you system drive is not C:, you MUST change the line:
echo     SET SYSTEM_DRIVE=C:
echo.
echo   Press ANY KEY to continue...
echo.
pause>nul
:--------------------------------------

:: ScanDisk All 
:--------------------------------------
@echo off
REM The System Drive must be specially treated.
SET SYSTEM_DRIVE=C:

REM check Win8+ capabilities (requires WindowsVersionChecker)
if 62 LEQ %WMajor%%WMinor% (set CHKDSK_NG=1) else (set CHKDSK_NG=0)
if %CHKDSK_NG% == 1 (echo Info chkdsk: new capabilities enabled)

REM ^, -- ^ is the escape character for declarations  between '
for %%a in (%*) do (
    echo.
    echo ________________________________________
    if "%%a" == "%SYSTEM_DRIVE%" (
        if %CHKDSK_NG% == 1 (
            echo ### Read-Only ScanDisk of System Drive %%a
            chkdsk /scan /perf /forceofflinefix %%a
            echo ### Run System File Checker on System Drive %%a
            sfc /scannow
        ) else (
            echo Set ### System Drive %%a as dirty to force boot-scandisk scan
            fsutil dirty set %%a
        )
    ) else (
        echo ### Two-steps ScanDisk of unit %%a
        if %CHKDSK_NG% == 1 (
            REM http://www.minasi.com/newsletters/nws1305.htm (chkdsk Win 8+ features)
            chkdsk /scan /perf /forceofflinefix %%a
            chkdsk /X /offlinescanandfix %%a
        ) else (
            REM Old scan (backward compatibility              chkdsk /F /X %%a
            chkdsk /F /X /R /B %%a
        )
    )
)
:--------------------------------------

:: Power off routine 
rem :--------------------------------------
rem @echo off
rem echo Preparing to shutdown..."
rem shutdown /s /t 120
rem echo Press enter to abort shutdown
rem pause > nul
rem shutdown /a
rem echo Shutdown aborted
rem pause
rem :--------------------------------------

ScanDiskAll.bat (扫描修复机器上所有检测到的硬盘,可选扫描后重启)

:: BatchGotAdmin 
:-------------------------------------
@echo off
REM  --> Check for permissions
>nul 2>&1 "%SYSTEMROOT%system32cacls.exe" "%SYSTEMROOT%system32configsystem"

REM --> If error flag set, we do not have admin.
if '%errorlevel%' NEQ '0' (
    echo Requesting administrative privileges...
    goto UACPrompt
) else ( goto gotAdmin )

:UACPrompt
    echo Set UAC = CreateObject^("Shell.Application"^) > "%temp%getadmin.vbs"
    echo UAC.ShellExecute "%~s0", "", "", "runas", 1 >> "%temp%getadmin.vbs"

    "%temp%getadmin.vbs"
    exit /B

:gotAdmin
    if exist "%temp%getadmin.vbs" ( del "%temp%getadmin.vbs" )
    pushd "%CD%"
    CD /D "%~dp0"
    @echo on
:--------------------------------------

:: WindowsVersionChecker (detect OS) 
:--------------------------------------
@ECHO off
REM https://msdn.microsoft.com/en-us/library/windows/desktop/ms724832.aspx
REM 10.0 -- Win 10, Win Server 2016 TP2
REM 6.4 -- Win 10 TP, Win Server 2016 TP1
REM 6.3 -- Win 8.1, Win Server 2012 R2
REM 6.2 -- Win 8, Win Server 2012
REM 6.1 -- Win 7, Win Server 2008 R2
REM 6.0 -- Win Vista, Win Server 2008
REM 5.2 -- Win Server 2003, Win Server 2003 R2, Win XP 64-Bit Edition
REM 5.1 -- Win XP
REM 5.0 -- Win 2000

FOR /f "tokens=4,5,6 delims=[]. " %%a IN ('ver') DO (
	SET WVer=%%a.%%b.%%c
	SET WMajor=%%a
	SET WMinor=%%b
	SET WRev=%%c
)
:--------------------------------------

:: ScanDisk All::PrintInfo  (c) 2015 BSD-Clause 3
:--------------------------------------
@echo off
echo.
echo == ScanDisk All ==
echo   (C) 2014-2015 "" BSD-Clause 3
echo.
echo   This program will run CHKDSK on all drives in an unattended manner.
echo   CHKDSK will be done in a two-steps way for safer execution.
echo   The computer will be shutdown after finishing, but can be aborted
echo   by pressing enter.
echo   Supports:
echo     * NTFS
echo     * FAT32
echo     * New generation CKHDSK commands (/scan /perf ...)
echo     * Special treatment of SYSTEM drive (C: as default).
echo       - Includes "sfc /scannow" for check system files integrity.
echo.
echo   Notice that if you system drive is not C:, you MUST change the line:
echo     SET SYSTEM_DRIVE=C:
echo.
echo   Press ANY KEY to continue...
echo.
pause>nul
:--------------------------------------

:: ScanDisk All 
:--------------------------------------
@echo off
REM The System Drive must be specially treated.
SET SYSTEM_DRIVE=C:

REM check Win8+ capabilities (requires WindowsVersionChecker)
if 62 LEQ %WMajor%%WMinor% (set CHKDSK_NG=1) else (set CHKDSK_NG=0)
if %CHKDSK_NG% == 1 (echo Info chkdsk: new capabilities enabled)

REM ^, -- ^ is the escape character for declarations  between '
for /f "skip=1 tokens=1,2 delims= " %%a in ('wmic logicaldisk get caption^,filesystem') do (
	echo.
	echo ________________________________________
	if "%%a" == "%SYSTEM_DRIVE%" (
		if %CHKDSK_NG% == 1 (
			echo ### Read-Only ScanDisk of System Drive %%a
			chkdsk /scan /perf /forceofflinefix %%a
			echo ### Run System File Checker on System Drive %%a
			sfc /scannow
		) else (
			echo Set ### System Drive %%a as dirty to force boot-scandisk scan
			fsutil dirty set %%a
		)
	) else if "%%b" == "NTFS" (
		echo ### Two-steps ScanDisk of %%b unit %%a
		if %CHKDSK_NG% == 1 (
			REM http://www.minasi.com/newsletters/nws1305.htm (chkdsk Win 8+ features)
			chkdsk /scan /perf /forceofflinefix %%a
			chkdsk /X /offlinescanandfix %%a
		) else (
			REM Old scan (backward compatibility  			chkdsk /F /X %%a
			chkdsk /F /X /R /B %%a
		)
	) else if "%%b" == "FAT32" (
		echo ### Two-steps ScanDisk of %%b unit %%a
		chkdsk /F /X %%a
		chkdsk /F /X /R %%a
	)
)
:--------------------------------------

:: Power off routine 
rem :--------------------------------------
rem @echo off
rem echo Preparing to shutdown..."
rem shutdown /s /t 120
rem echo Press enter to abort shutdown
rem pause > nul
rem shutdown /a
rem echo Shutdown aborted
rem pause
rem :--------------------------------------

参考:

https://borncity.com/win/2020/12/18/windows-10-20h2-chkdsk-damages-file-system-on-ssds-with-update-kb4592438-installed/

点击显示引用框
引用本文,复制粘贴...