Win7 使用久了會因垃圾檔案堆積、惡意程式佔用資源、開機啟動項過多而變慢。本文提供三支可直接複製使用的批次檔腳本:清除系統垃圾.bat(15 類暫存/快取/日誌)、查毒.bat(針對常見蠕蟲病毒檔案名稱/共享刪除)、優化開機.bat(清理 Run/RunOnce 登錄鍵值、啟動資料夾、保留輸入法 ctfmon),並附製作與執行圖文教學。
@echo off
echo 正在清除系統垃圾檔案,請稍等......
del /f /s /q %systemdrive%\*.tmp
del /f /s /q %systemdrive%\*._mp
del /f /s /q %systemdrive%\*.log
del /f /s /q %systemdrive%\*.gid
del /f /s /q %systemdrive%\*.chk
del /f /s /q %systemdrive%\*.old
del /f /s /q %systemdrive%\recycled\*.*
del /f /s /q %windir%\*.bak
del /f /s /q %windir%\prefetch\*.*
rd /s /q %windir%\temp & md %windir%\temp
del /f /q %userprofile%\cookies\*.*
del /f /q %userprofile%\recent\*.*
del /f /s /q "%userprofile%\Local Settings\Temporary Internet Files\*.*"
del /f /s /q "%userprofile%\Local Settings\Temp\*.*"
del /f /s /q "%userprofile%\recent\*.*"
echo 清除系統垃圾完成!
echo. & pause
@ECHO OFF
del c:\winnt\logo1_.exe
del c:\windows\logo1_.exe
del c:\winnt\0sy.exe
del c:\windows\0sy.exe
...(其餘同源碼刪除 sy 系列、rundl132.exe、vdll.dll、tdll.dll、dll.dll、kill.exe、sws32.dll、bootconf.exe、_desktop.ini 等)
echo *****************************
echo 正在查毒...請不要關閉......
echo *****************************
ping 127.0.0.1 -n 5
...(system32 目錄同樣刪除上述檔案)
@ ECHO OFF
color 1f
title 清除所有多餘的啟動項目
PAUSE
reg delete HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Run /va /f
reg delete HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Run /va /f
reg add HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Run /v ctfmon.exe /d C:\WINDOWS\system32\ctfmon.exe
reg delete "HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Shared Tools\MSConfig\startupreg" /f
...(重新寫入 IMJPMIG8.1、PHIME2002A 等輸入法必要啟動項)
del "C:\Documents and Settings\All Users\開始選單\程式\啟動\*.*" /q /f
del "C:\Documents and Settings\Default User\開始選單\程式\啟動\*.*" /q /f
del "%userprofile%\開始選單\程式\啟動\*.*" /q /f
start C:\WINDOWS\pchealth\helpctr\binaries\msconfig.exe
清除系統垃圾.bat / 查毒.bat / 優化開機.bat。

