Board logo

标题: [文件操作] bat垃圾清理代码 [打印本页]

作者: Aub    时间: 2020-3-26 17:06     标题: bat垃圾清理代码

  1. @echo off
  2. title  垃圾清理
  3. echo Windows版本%OS%
  4. echo 如有重要log文件,请转为txt或dic文本文档格式
  5. echo 准备好了吗(按任意键开始) & pause > nul
  6. echo ~ >>once_do.txt
  7. echo 正在清理系统垃圾文件,请稍等......
  8. echo %systemdrive%\*.tmp >>once_do.txt
  9. del /f /s /q %systemdrive%\*.tmp
  10. echo %systemdrive%\*._mp >>once_do.txt
  11. del /f /s /q %systemdrive%\*._mp
  12. echo %systemdrive%\*.log >>once_do.txt
  13. del /f /s /q %systemdrive%\*.log
  14. echo %systemdrive%\*.gid >>once_do.txt
  15. del /f /s /q %systemdrive%\*.gid
  16. echo %systemdrive%\*.chk >>once_do.txt
  17. del /f /s /q %systemdrive%\*.chk
  18. echo %systemdrive%\*.old >>once_do.txt
  19. del /f /s /q %systemdrive%\*.old
  20. echo %systemdrive%\recycled\*.* >>once_do.txt
  21. del /f /s /q %systemdrive%\recycled\*.*
  22. echo %systemdrive%\*.bak >>once_do.txt
  23. del /f /s /q %windir%\*.bak
  24. echo %systemdrive%\prefetch\*.* >>once_do.txt
  25. del /f /s /q %windir%\prefetch\*.*
  26. rd /s /q %windir%\temp & md %windir%\temp
  27. echo %userprofile%\cookies\*.* >>once_do.txt
  28. del /f /q %userprofile%\cookies\*.*
  29. echo %userprofile%\recent\*.* >>once_do.txt
  30. del /f /q %userprofile%\recent\*.*
  31. echo "%userprofile%\Local Settings\Temporary Internet Files\*.*" >>once_do.txt
  32. del /f /s /q "%userprofile%\Local Settings\Temporary Internet Files\*.*"
  33. echo "%userprofile%\Local Settings\Temp\*.*" >>once_do.txt
  34. del /f /s /q "%userprofile%\Local Settings\Temp\*.*"
  35. echo "%userprofile%\recent\*.*" >>once_do.txt
  36. del /f /s /q "%userprofile%\recent\*.*"
  37. echo 清理系统垃圾完成!
  38. echo 清理系统垃圾完成! >>once_do.txt
  39. pause
复制代码





欢迎光临 批处理之家 (http://www.bathome.net/) Powered by Discuz! 7.2