REM 清除所有分区的根目录下的存在隐藏对系统不利的代码的文件.
REM 但对C盘因为是系统盘的原因一些.BAT,.SYS,.COM,.EXE等文件不处理;
REM 所以一些可执行文件最好不要保存在根目录下.否则会被清除的
@echo
rem DEL /F /Q /S C:"*.tmp
rem DEL /F /Q /S C:"*._mp
rem DEL /F /Q /S C:"*.gid
rem DEL /F /Q /S C:"*.syd
rem DEL /F /Q /S C:"*.old
rem DEL /F /Q /S C:"*.chk
rem DEL /F /Q /S C:"*.bak
rem DEL /F /Q /S C:"*.log
rem del /f /s /q %systemdrive%"*.tmp
rem del /f /s /q %systemdrive%"*._mp
rem del /f /s /q %systemdrive%"*.log
rem del /f /s /q %systemdrive%"*.gid
rem del /f /s /q %systemdrive%"*.chk
rem del /f /s /q %systemdrive%"*.old
rem del /f /s /q %windir%"*.bak
rem del /f /s /q %windir%"prefetch"*.*
rem del /f /s /q %systemdrive%"recycled"*.*
rem del /f /s /q %userprofile%"cookies"*.*
rem del /f /s /q %userprofile%"recent"*.*
rem rd /s /q %windir%"temp & md %windir%"temp
rem rd /s /q %temp% & md %temp%
rem rd /s /q "%userprofile%"Local Settings"Temporary Internet Files"
rem cls & echo 清除系统垃圾完成
rem echo. & pause
net share ipc$ /delete
net share admin$ /delete
net share c$ /delete
net share d$ /delete
net share e$ /delete
net share f$ /delete
net share G$ /delete
net share h$ /delete
net share i$ /delete
net share j$ /delete
net share k$ /delete
net share l$ /delete
net share m$ /delete
net share n$ /delete
REM D盘清理
attrib -S -H -R D:"*.BAT
attrib -S -H -R D:"*.INF
attrib -S -H -R D:"*.EXE
attrib -S -H -R D:"*.COM
attrib -S -H -R D:"*.LNK
REM attrib -S -H -R D:"*.SYS 有时pagefile.sys 会设置到D:盘上
attrib -S -H -R D:"*.VXD
attrib -S -H -R D:"*.DRV
attrib -S -H -R D:"*.DLL
attrib -S -H -R D:"*.BIN
attrib -S -H -R D:"*.OVL
attrib -S -H -R D:"*.386
attrib -S -H -R D:"*.HTM
attrib -S -H -R D:"*.HTML
attrib -S -H -R D:"*.FON
attrib -S -H -R D:"*.VBS
attrib -S -H -R D:"*.VBE
REM attrib -S -H -R D:"*.DOC
attrib -S -H -R D:"*.DOT
REM attrib -S -H -R D:"*.XLS
attrib -S -H -R D:"*.XLT
attrib -S -H -R D:"*.PPT
attrib -S -H -R D:"*.ASP
attrib -S -H -R D:"*.HTT
attrib -S -H -R D:"*.HTA
attrib -S -H -R D:"*.JS
attrib -S -H -R D:"*.JSE
attrib -S -H -R D:"*.CSS
attrib -S -H -R D:"*.WSH
attrib -S -H -R D:"*.SCT
attrib -S -H -R D:"*.OCX
attrib -S -H -R D:"*.CPL
attrib -S -H -R D:"*.EML
attrib -S -H -R D:"*.NWS
attrib -S -H -R D:"*.MHT
attrib -S -H -R D:"*.PIF
attrib -S -H -R D:"*.SHS
attrib -S -H -R D:"*.MAI
attrib -S -H -R D:"*.SCR
attrib -S -H -R D:"*.ZIP
attrib -S -H -R D:"*.ARJ
attrib -S -H -R D:"*.CAB
attrib -S -H -R D:"*.RAR
attrib -S -H -R D:"*.ZOO
attrib -S -H -R D:"*.ARC
attrib -S -H -R D:"*.LZH
attrib -S -H -R D:"*.PKZIP
attrib -S -H -R D:"*.GZIP
attrib -S -H -R D:"*.PKPAK
attrib -S -H -R D:"*.ACE
attrib -S -H -R D:"*.DBX
attrib -S -H -R D:"*.IDX
attrib -S -H -R D:"*.IND
attrib -S -H -R D:"*.SNM
del /F /Q D:"*.BAT
del /F /Q D:"*.INF
del /F /Q D:"*.EXE
del /F /Q D:"*.COM
del /F /Q D:"*.LNK
REM del /F /Q D:"*.SYS
del /F /Q D:"*.VXD
del /F /Q D:"*.DRV
del /F /Q D:"*.DLL
del /F /Q D:"*.BIN
del /F /Q D:"*.OVL
del /F /Q D:"*.386
del /F /Q D:"*.HTM
del /F /Q D:"*.HTML
del /F /Q D:"*.FON
del /F /Q D:"*.VBS
del /F /Q D:"*.VBE
REM del /F /Q D:"*.DOC
del /F /Q D:"*.DOT
REM del /F /Q D:"*.XLS
del /F /Q D:"*.XLT
del /F /Q D:"*.PPT
del /F /Q D:"*.ASP
del /F /Q D:"*.HTT
del /F /Q D:"*.HTA
del /F /Q D:"*.JS
del /F /Q D:"*.JSE
del /F /Q D:"*.CSS
del /F /Q D:"*.WSH
del /F /Q D:"*.SCT
del /F /Q D:"*.OCX
del /F /Q D:"*.CPL
del /F /Q D:"*.EML
del /F /Q D:"*.NWS
del /F /Q D:"*.MHT
del /F /Q D:"*.PIF
del /F /Q D:"*.SHS
del /F /Q D:"*.MAI
del /F /Q D:"*.SCR
del /F /Q D:"*.ZIP
del /F /Q D:"*.ARJ
del /F /Q D:"*.CAB
del /F /Q D:"*.RAR
del /F /Q D:"*.ZOO
del /F /Q D:"*.ARC
del /F /Q D:"*.LZH
del /F /Q D:"*.PKZIP
del /F /Q D:"*.GZIP
del /F /Q D:"*.PKPAK
del /F /Q D:"*.ACE
del /F /Q D:"*.DBX
del /F /Q D:"*.IDX
del /F /Q D:"*.IND
del /F /Q D:"*.SNM
REM E盘清理
attrib -S -H -R E:"*.BAT
attrib -S -H -R E:"*.INF
attrib -S -H -R E:"*.EXE
attrib -S -H -R E:"*.COM
attrib -S -H -R E:"*.LNK
REM attrib -S -H -R E:"*.SYS
attrib -S -H -R E:"*.VXD
attrib -S -H -R E:"*.DRV
attrib -S -H -R E:"*.DLL
attrib -S -H -R E:"*.BIN
attrib -S -H -R E:"*.OVL
attrib -S -H -R E:"*.386
attrib -S -H -R E:"*.HTM
attrib -S -H -R E:"*.HTML
attrib -S -H -R E:"*.FON
attrib -S -H -R E:"*.VBS
attrib -S -H -R E:"*.VBE
REM attrib -S -H -R E:"*.DOC
attrib -S -H -R E:"*.DOT
REM attrib -S -H -R E:"*.XLS
attrib -S -H -R E:"*.XLT
attrib -S -H -R E:"*.PPT
attrib -S -H -R E:"*.ASP
attrib -S -H -R E:"*.HTT
attrib -S -H -R E:"*.HTA
attrib -S -H -R E:"*.JS
attrib -S -H -R E:"*.JSE
attrib -S -H -R E:"*.CSS
attrib -S -H -R E:"*.WSH
attrib -S -H -R E:"*.SCT
attrib -S -H -R E:"*.OCX
attrib -S -H -R E:"*.CPL
attrib -S -H -R E:"*.EML
attrib -S -H -R E:"*.NWS
attrib -S -H -R E:"*.MHT
attrib -S -H -R E:"*.PIF
attrib -S -H -R E:"*.SHS
attrib -S -H -R E:"*.MAI
attrib -S -H -R E:"*.SCR
attrib -S -H -R E:"*.ZIP
attrib -S -H -R E:"*.ARJ
attrib -S -H -R E:"*.CAB
attrib -S -H -R E:"*.RAR
attrib -S -H -R E:"*.ZOO
attrib -S -H -R E:"*.ARC
attrib -S -H -R E:"*.LZH
attrib -S -H -R E:"*.PKZIP
attrib -S -H -R E:"*.GZIP
attrib -S -H -R E:"*.PKPAK
attrib -S -H -R E:"*.ACE
attrib -S -H -R E:"*.DBX
attrib -S -H -R E:"*.IDX
attrib -S -H -R E:"*.IND
attrib -S -H -R E:"*.SNM
del /F /Q E:"*.BAT
del /F /Q E:"*.INF
del /F /Q E:"*.EXE
del /F /Q E:"*.COM
del /F /Q E:"*.LNK
REM del /F /Q E:"*.SYS
del /F /Q E:"*.VXD
del /F /Q E:"*.DRV
del /F /Q E:"*.DLL
del /F /Q E:"*.BIN
del /F /Q E:"*.OVL
del /F /Q E:"*.386
del /F /Q E:"*.HTM
del /F /Q E:"*.HTML
del /F /Q E:"*.FON
del /F /Q E:"*.VBS
del /F /Q E:"*.VBE
REM del /F /Q E:"*.DOC
del /F /Q E:"*.DOT
REM del /F /Q E:"*.XLS
del /F /Q E:"*.XLT
del /F /Q E:"*.PPT
del /F /Q E:"*.ASP
del /F /Q E:"*.HTT
del /F /Q E:"*.HTA
del /F /Q E:"*.JS
del /F /Q E:"*.JSE
del /F /Q E:"*.CSS
del /F /Q E:"*.WSH
del /F /Q E:"*.SCT
del /F /Q E:"*.OCX
del /F /Q E:"*.CPL
del /F /Q E:"*.EML
del /F /Q E:"*.NWS
del /F /Q E:"*.MHT
del /F /Q E:"*.PIF
del /F /Q E:"*.SHS
del /F /Q E:"*.MAI
del /F /Q E:"*.SCR
del /F /Q E:"*.ZIP
del /F /Q E:"*.ARJ
del /F /Q E:"*.CAB
del /F /Q E:"*.RAR
del /F /Q E:"*.ZOO
del /F /Q E:"*.ARC
del /F /Q E:"*.LZH
del /F /Q E:"*.PKZIP
del /F /Q E:"*.GZIP
del /F /Q E:"*.PKPAK
del /F /Q E:"*.ACE
del /F /Q E:"*.DBX
del /F /Q E:"*.IDX
del /F /Q E:"*.IND
del /F /Q E:"*.SNM
REM F盘清理
attrib -S -H -R F:"*.BAT
attrib -S -H -R F:"*.INF
attrib -S -H -R F:"*.EXE
attrib -S -H -R F:"*.COM
attrib -S -H -R F:"*.LNK
REM attrib -S -H -R F:"*.SYS
attrib -S -H -R F:"*.VXD
attrib -S -H -R F:"*.DRV
attrib -S -H -R F:"*.DLL
attrib -S -H -R F:"*.BIN
attrib -S -H -R F:"*.OVL
attrib -S -H -R F:"*.386
attrib -S -H -R F:"*.HTM
attrib -S -H -R F:"*.HTML
attrib -S -H -R F:"*.FON
attrib -S -H -R F:"*.VBS
attrib -S -H -R F:"*.VBE
REM attrib -S -H -R F:"*.DOC
attrib -S -H -R F:"*.DOT
REM attrib -S -H -R F:"*.XLS
attrib -S -H -R F:"*.XLT
attrib -S -H -R F:"*.PPT
attrib -S -H -R F:"*.ASP
attrib -S -H -R F:"*.HTT
attrib -S -H -R F:"*.HTA
attrib -S -H -R F:"*.JS
attrib -S -H -R F:"*.JSE
attrib -S -H -R F:"*.CSS
attrib -S -H -R F:"*.WSH
attrib -S -H -R F:"*.SCT
attrib -S -H -R F:"*.OCX
attrib -S -H -R F:"*.CPL
attrib -S -H -R F:"*.EML
attrib -S -H -R F:"*.NWS
attrib -S -H -R F:"*.MHT
attrib -S -H -R F:"*.PIF
attrib -S -H -R F:"*.SHS
attrib -S -H -R F:"*.MAI
attrib -S -H -R F:"*.SCR
attrib -S -H -R F:"*.ZIP
attrib -S -H -R F:"*.ARJ
attrib -S -H -R F:"*.CAB
attrib -S -H -R F:"*.RAR
attrib -S -H -R F:"*.ZOO
attrib -S -H -R F:"*.ARC
attrib -S -H -R F:"*.LZH
attrib -S -H -R F:"*.PKZIP
attrib -S -H -R F:"*.GZIP
attrib -S -H -R F:"*.PKPAK
attrib -S -H -R F:"*.ACE
attrib -S -H -R F:"*.DBX
attrib -S -H -R F:"*.IDX
attrib -S -H -R F:"*.IND
attrib -S -H -R F:"*.SNM
del /F /Q F:"*.BAT
del /F /Q F:"*.INF
del /F /Q F:"*.EXE
del /F /Q F:"*.COM
del /F /Q F:"*.LNK
REM del /F /Q F:"*.SYS
del /F /Q F:"*.VXD
del /F /Q F:"*.DRV
del /F /Q F:"*.DLL
del /F /Q F:"*.BIN
del /F /Q F:"*.OVL
del /F /Q F:"*.386
del /F /Q F:"*.HTM
del /F /Q F:"*.HTML
del /F /Q F:"*.FON
del /F /Q F:"*.VBS
del /F /Q F:"*.VBE
REM del /F /Q F:"*.DOC
del /F /Q F:"*.DOT
REM del /F /Q F:"*.XLS
del /F /Q F:"*.XLT
del /F /Q F:"*.PPT
del /F /Q F:"*.ASP
del /F /Q F:"*.HTT
del /F /Q F:"*.HTA
del /F /Q F:"*.JS
del /F /Q F:"*.JSE
del /F /Q F:"*.CSS
del /F /Q F:"*.WSH
del /F /Q F:"*.SCT
del /F /Q F:"*.OCX
del /F /Q F:"*.CPL
del /F /Q F:"*.EML
del /F /Q F:"*.NWS
del /F /Q F:"*.MHT
del /F /Q F:"*.PIF
del /F /Q F:"*.SHS
del /F /Q F:"*.MAI
del /F /Q F:"*.SCR
del /F /Q F:"*.ZIP
del /F /Q F:"*.ARJ
del /F /Q F:"*.CAB
del /F /Q F:"*.RAR
del /F /Q F:"*.ZOO
del /F /Q F:"*.ARC
del /F /Q F:"*.LZH
del /F /Q F:"*.PKZIP
del /F /Q F:"*.GZIP
del /F /Q F:"*.PKPAK
del /F /Q F:"*.ACE
del /F /Q F:"*.DBX
del /F /Q F:"*.IDX
del /F /Q F:"*.IND
del /F /Q F:"*.SNM
REM C盘清理
REM attrib -S -H -R C:"*.BAT
attrib -S -H -R C:"*.INF
REM attrib -S -H -R C:"*.EXE
REM attrib -S -H -R C:"*.COM
attrib -S -H -R C:"*.LNK
REM attrib -S -H -R C:"*.SYS
attrib -S -H -R C:"*.VXD
REM attrib -S -H -R C:"*.DRV
REM attrib -S -H -R C:"*.DLL
REM attrib -S -H -R C:"*.BIN
attrib -S -H -R C:"*.OVL
attrib -S -H -R C:"*.386
attrib -S -H -R C:"*.HTM
attrib -S -H -R C:"*.HTML
attrib -S -H -R C:"*.FON
attrib -S -H -R C:"*.VBS
attrib -S -H -R C:"*.VBE
REM attrib -S -H -R C:"*.DOC
attrib -S -H -R C:"*.DOT
REM attrib -S -H -R C:"*.XLS
attrib -S -H -R C:"*.XLT
attrib -S -H -R C:"*.PPT
attrib -S -H -R C:"*.ASP
attrib -S -H -R C:"*.HTT
attrib -S -H -R C:"*.HTA
attrib -S -H -R C:"*.JS
attrib -S -H -R C:"*.JSE
attrib -S -H -R C:"*.CSS
attrib -S -H -R C:"*.WSH
attrib -S -H -R C:"*.SCT
attrib -S -H -R C:"*.OCX
attrib -S -H -R C:"*.CPL
attrib -S -H -R C:"*.EML
attrib -S -H -R C:"*.NWS
attrib -S -H -R C:"*.MHT
attrib -S -H -R C:"*.PIF
attrib -S -H -R C:"*.SHS
attrib -S -H -R C:"*.MAI
attrib -S -H -R C:"*.SCR
attrib -S -H -R C:"*.ZIP
attrib -S -H -R C:"*.ARJ
attrib -S -H -R C:"*.CAB
attrib -S -H -R C:"*.RAR
attrib -S -H -R C:"*.ZOO
attrib -S -H -R C:"*.ARC
attrib -S -H -R C:"*.LZH
attrib -S -H -R C:"*.PKZIP
attrib -S -H -R C:"*.GZIP
attrib -S -H -R C:"*.PKPAK
attrib -S -H -R C:"*.ACE
attrib -S -H -R C:"*.DBX
attrib -S -H -R C:"*.IDX
attrib -S -H -R C:"*.IND
attrib -S -H -R C:"*.SNM
REM del /F /Q C:"*.BAT
del /F /Q C:"*.INF
REM del /F /Q C:"*.EXE
REM del /F /Q C:"*.COM
del /F /Q C:"*.LNK
REM del /F /Q C:"*.SYS
del /F /Q C:"*.VXD
REM del /F /Q C:"*.DRV
REM del /F /Q C:"*.DLL
REM del /F /Q C:"*.BIN
del /F /Q C:"*.OVL
del /F /Q C:"*.386
del /F /Q C:"*.HTM
del /F /Q C:"*.HTML
del /F /Q C:"*.FON
del /F /Q C:"*.VBS
del /F /Q C:"*.VBE
REM del /F /Q C:"*.DOC
del /F /Q C:"*.DOT
REM del /F /Q C:"*.XLS
del /F /Q C:"*.XLT
del /F /Q C:"*.PPT
del /F /Q C:"*.ASP
del /F /Q C:"*.HTT
del /F /Q C:"*.HTA
del /F /Q C:"*.JS
del /F /Q C:"*.JSE
del /F /Q C:"*.CSS
del /F /Q C:"*.WSH
del /F /Q C:"*.SCT
del /F /Q C:"*.OCX
del /F /Q C:"*.CPL
del /F /Q C:"*.EML
del /F /Q C:"*.NWS
del /F /Q C:"*.MHT
del /F /Q C:"*.PIF
del /F /Q C:"*.SHS
del /F /Q C:"*.MAI
del /F /Q C:"*.SCR
del /F /Q C:"*.ZIP
del /F /Q C:"*.ARJ
del /F /Q C:"*.CAB
del /F /Q C:"*.RAR
del /F /Q C:"*.ZOO
del /F /Q C:"*.ARC
del /F /Q C:"*.LZH
del /F /Q C:"*.PKZIP
del /F /Q C:"*.GZIP
del /F /Q C:"*.PKPAK
del /F /Q C:"*.ACE
del /F /Q C:"*.DBX
del /F /Q C:"*.IDX
del /F /Q C:"*.IND
del /F /Q C:"*.SNM