echo 如果您在最近的Windows系統更新后,系統運行不正常,請按下Ctrl+C終止清理。 pause echo 正在清理注冊表中的相關內容... rem 建立注冊表清理和log文件清理的子批處理文件 echo @echo off>c:\tmp.bat echo if %%tp:~12,-1%%!==! goto end>>c:\tmp.bat echo echo Windows Registry Editor Version 5.00^>c:\tmp.reg>>c:\tmp.bat echo echo.^>^>c:\tmp.reg>>c:\tmp.bat echo echo [-HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall\%%tp:~12,-1%%]^>^>^c:\tmp.reg>>c:\tmp.bat rem 如果要清除注冊表ARPCache項中的內容,那么可以將下面一行前面的兩個冒號去掉 ::echo echo [-HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\App Management\ARPCache\%%tp:~12,-1%%]^>^>^c:\tmp.reg>>c:\tmp.bat echo regedit /s c:\tmp.reg>>c:\tmp.bat echo if exist %%windir%%\%%tp:~12,-1%%.log del %%windir%%\%%tp:~12,-1%%.log>>c:\tmp.bat echo :end>>c:\tmp.bat rem 檢測要刪除的內容,結果保存到c:\tmp.txt中 dir %windir%\$Nt*$ /b/ad>c:\tmp.txt if not exist c:\tmp.txt goto end rem 調用子批處理文件,將檢測到的內容清理掉 for /f %%v in ('findstr "KB Q" c:\tmp.txt') do ( set tp=%%v call c:\tmp.bat ) rem 清理磁盤中的文件夾 echo 正在清理文件,可能需要較長時間,清理完畢此窗口會自動關閉.請等待.... for /f %%i in ('dir %%windir%%\$*$ /b/ad') do rd %windir%\%%i /s/q rem 善后工作 :end if exist c:\tmp.txt del c:\tmp.txt if exist c:\tmp.bat del c:\tmp.bat if exist c:\tmp.reg reg c:\tmp.reg