微软在2020年1月14日以后将结束对Windows7系统的支持,前期发布的补丁会包含一个如下图的全屏提示。点击“不在提醒我”也可以关闭并且后期不在提示,但残留的文件还存在。通过网络搜索,找到个一键清理的批处理命令,在此做个笔记。(注:从本站下载的Windows7系统已包含此命令)

复制下方命令,新建txt文档,粘贴并另存为.bat或.cmd即可
- @ECHO OFF
 
- >NUL 2>&1 "%SYSTEMROOT%\system32\cacls.exe" "%SYSTEMROOT%\system32\config\system"
 
- IF '%errorlevel%' NEQ '0' (
 
- 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" )
 
- TITLE EOSNotify-清理
 
- CLS
 
- TIMEOUT 3 >NUL
 
- SET winsxs=%SystemRoot%\winsxs
 
- ECHO.
 
- ECHO 清理EOSNotify WinSXS...
 
- FOR /f %%i IN ('dir /b %winsxs%\^|findstr ".*microsoft-windows-eosnotify.*"') DO (
 
- takeown /a /r /d Y /f "%winsxs%\%%i" >NUL
 
- icacls "%winsxs%\%%i" /T /C /grant administrators:D >NUL
 
- ECHO 正在删除WinSXS
 
- ECHO %%i
 
- RMDIR /s /q "%winsxs%\%%i"
 
- )
 
- ECHO.
 
- ECHO 清理EOSNotify manifest...
 
- FOR /f %%i IN ('dir /b %winsxs%\Manifests^|findstr ".*microsoft-windows-eosnotify.*\.manifest"') DO (
 
- takeown /a /f "%winsxs%\Manifests\%%i" >NUL
 
- icacls "%winsxs%\Manifests\%%i" /grant administrators:D >NUL
 
- DEL /F /S /Q "%winsxs%\Manifests\%%i"
 
- )
 
- TIMEOUT 3 >NUL
 
- ECHO.
 
- ECHO 删除EOSNotify 注册表...
 
- FOR /f %%i IN ('REG QUERY HKLM\SOFTWARE\Microsoft\Windows\CurrentVersion\SideBySide\Winners^|findstr ".*microsoft-windows-eosnotify.*"') DO (
 
- ECHO 正在删除注册表
 
- reg delete %%i /f
 
- )
 
- TIMEOUT 3 >NUL
 
- ECHO.
 
- ECHO 删除EOSNotify计划任务...
 
- schtasks /delete /tn "\Microsoft\Windows\Setup\EOSNotify" /f
 
- schtasks /delete /tn "\Microsoft\Windows\Setup\EOSNotify2" /f
 
- TIMEOUT 3 >NUL
 
- IF EXIST "%SystemRoot%\System32\EOSNotify.exe" (
 
- ECHO.
 
- ECHO 删除 EOSNotify.exe 文件...
 
- taskkill /F /IM "%SystemRoot%\System32\EOSNotify.exe" 1>NUL 2>NUL
 
- takeown /a /f "%SystemRoot%\System32\EOSNotify.exe" >NUL
 
- icacls "%SystemRoot%\System32\EOSNotify.exe" /grant administrators:D >NUL
 
- DEL /F /S /Q "%SystemRoot%\System32\EOSNotify.exe"
 
- )
 
- IF EXIST "%SystemRoot%\Migration\WTR\EOSNotifyMig.inf" (
 
- ECHO.
 
- ECHO 删除 EOSNotifyMig.inf 文件...
 
- DEL /F /S /Q "%SystemRoot%\Migration\WTR\EOSNotifyMig.inf"
 
- )
 
- TIMEOUT 3 >NUL
 
- ECHO.
 
- ECHO 优化EOSNotify 注册表设置...
 
- reg add "HKCU\Software\Microsoft\Windows\CurrentVersion\SipNotify" /v "DontRemindMe" /t REG_DWORD /d "1" /f
 
- reg add "HKLM\Software\Policies\Microsoft\Windows\Gwx" /v "DisableGwx" /t REG_DWORD /d "1" /f
 
- reg add "HKLM\Software\Policies\Microsoft\Windows\WindowsUpdate" /v "DisableOSUpgrade" /t REG_DWORD /d "1" /f
 
- reg add "HKLM\SOFTWARE\Microsoft\Windows NT\CurrentVersion\Image File Execution Options\EOSNOTIFY.EXE" /v "Debugger" /t REG_SZ /d "*" /f
 
- reg add "HKLM\SOFTWARE\Microsoft\Windows NT\CurrentVersion\Image File Execution Options\SIPNOTIFY.EXE" /v "Debugger" /t REG_SZ /d "*" /f
 
- reg add "HKCU\Software\Microsoft\Windows\CurrentVersion\EOSNotify" /v "DiscontinueEOS" /t REG_DWORD /d "1" /f
 
- reg add "HKCU\Software\Microsoft\Windows\CurrentVersion\EOSNotify" /v "Discontinue" /t REG_DWORD /d "1" /f
 
- reg delete "HKCU\Software\Microsoft\Windows\CurrentVersion\EOSNotify" /v "LastRunTimestamp" /f
 
- TIMEOUT 3 >NUL
 
- ECHO.
 
- ECHO 按任意键退出……
 
- PAUSE >NUL
 
- EXIT
 
 
懒人版下载:蓝奏云
                 
                                
                
                
                                
                
       
               本文由 木易梧桐's Blog 作者:metest 发表,转载请注明来源!