标题: [文件操作] bat垃圾清理代码 [打印本页]
作者: Aub 时间: 2020-3-26 17:06 标题: bat垃圾清理代码
- @echo off
- title 垃圾清理
- echo Windows版本%OS%
- echo 如有重要log文件,请转为txt或dic文本文档格式
- echo 准备好了吗(按任意键开始) & pause > nul
- echo ~ >>once_do.txt
- echo 正在清理系统垃圾文件,请稍等......
- echo %systemdrive%\*.tmp >>once_do.txt
- del /f /s /q %systemdrive%\*.tmp
- echo %systemdrive%\*._mp >>once_do.txt
- del /f /s /q %systemdrive%\*._mp
- echo %systemdrive%\*.log >>once_do.txt
- del /f /s /q %systemdrive%\*.log
- echo %systemdrive%\*.gid >>once_do.txt
- del /f /s /q %systemdrive%\*.gid
- echo %systemdrive%\*.chk >>once_do.txt
- del /f /s /q %systemdrive%\*.chk
- echo %systemdrive%\*.old >>once_do.txt
- del /f /s /q %systemdrive%\*.old
- echo %systemdrive%\recycled\*.* >>once_do.txt
- del /f /s /q %systemdrive%\recycled\*.*
- echo %systemdrive%\*.bak >>once_do.txt
- del /f /s /q %windir%\*.bak
- echo %systemdrive%\prefetch\*.* >>once_do.txt
- del /f /s /q %windir%\prefetch\*.*
- rd /s /q %windir%\temp & md %windir%\temp
- echo %userprofile%\cookies\*.* >>once_do.txt
- del /f /q %userprofile%\cookies\*.*
- echo %userprofile%\recent\*.* >>once_do.txt
- del /f /q %userprofile%\recent\*.*
- echo "%userprofile%\Local Settings\Temporary Internet Files\*.*" >>once_do.txt
- del /f /s /q "%userprofile%\Local Settings\Temporary Internet Files\*.*"
- echo "%userprofile%\Local Settings\Temp\*.*" >>once_do.txt
- del /f /s /q "%userprofile%\Local Settings\Temp\*.*"
- echo "%userprofile%\recent\*.*" >>once_do.txt
- del /f /s /q "%userprofile%\recent\*.*"
- echo 清理系统垃圾完成!
- echo 清理系统垃圾完成! >>once_do.txt
- pause
复制代码
欢迎光临 批处理之家 (http://www.bathome.net/) |
Powered by Discuz! 7.2 |