找回密码
 注册
快捷导航
查看: 981|回复: 0

【原创】再发个学习for做的清理当前用户临时/记录文件批处理

[复制链接] |自动提醒
阅读字号:

13

回帖

0

积分

40

资产值

入门会员 Rank: 1

注册时间
2008-3-17
发表于 2008-7-24 16:16:29| 字数 1,903| - 中国–浙江–温州 电信 | 显示全部楼层 |阅读模式
把下面的内容保存为.bat文件就可以了。
  1. @echo off
  2. rem Clean Temp Files
  3. rem Author:ZuiMeng UpData:2008/07/23
  4. title Clean Temp Files   Author:ZuiMeng
  5. color 1e
  6. cls
  7. %SystemDrive%
  8. echo In scavenging system's temporary file
  9. echo.
  10. echo Please press the Ctrl+C to Exit,
  11. echo Please press the random key to continue.
  12. pause>nul
  13. if exist "%temp%\cleantmp.txt" del /q "%temp%\cleantmp.txt"
  14. reg query "HKCU\software\Microsoft\Windows\CurrentVersion\Explorer\Shell Folders" /v Cache>%temp%\cleantmp.txt
  15. reg query "HKCU\software\Microsoft\Windows\CurrentVersion\Explorer\Shell Folders" /v Cookies>>%temp%\cleantmp.txt
  16. reg query "HKCU\software\Microsoft\Windows\CurrentVersion\Explorer\Shell Folders" /v History>>%temp%\cleantmp.txt
  17. reg query "HKCU\software\Microsoft\Windows\CurrentVersion\Explorer\Shell Folders" /v NetHood>>%temp%\cleantmp.txt
  18. reg query "HKCU\software\Microsoft\Windows\CurrentVersion\Explorer\Shell Folders" /v Recent>>%temp%\cleantmp.txt
  19. reg query "HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\Session Manager\Environment" /v Temp>>%temp%\cleantmp.txt
  20. for /f "eol=! tokens=3*" %%A in (%temp%\cleantmp.txt) do del /f /s /q "%%A %%B\*.*"
  21. if exist "%temp%\cleantmp.txt" del /q "%temp%\cleantmp.txt"
  22. del /f /s /q "%systemroot%\temp\*.*"
  23. del /f /s /q "%userprofile%\cookies\*.*"
  24. del /f /s /q "%userprofile%\UserData\*.*"
  25. del /f /s /q "%userprofile%\Local Settings\Temp\*.*"
  26. del /f /s /q "%userprofile%\Local Settings\Temporary Internet Files\*.*"
  27. del /f /s /q "%userprofile%\Local Settings\History\*.*"
  28. del /f /s /q "%temp%\*.*"
  29. del /f /s /q "%appdata%\Sun\Java\Deployment\cache\*.*"
  30. del /f /s /q "%appdata%\PTC\ProENGINEER\Wildfire\.wf\.cache2\*.*"
  31. del /f /s /q "%allusersprofile%\Application Data\thunder_vod_cache\*.*"
  32. echo.
  33. echo.
  34. echo.
  35. echo The operation has completed,
  36. echo Please press the random key to exit.
  37. pause>nul
  38. exit
复制代码
您需要登录后才可以回帖 登录 | 注册

本版积分规则

Powered by Discuz! X3.5 © 2001-2023 Comsenz Inc

GMT+8, 2025-1-31 03:50 , Processed in 0.071733 second(s), 24 queries , Gzip On, OPcache On.

手机版|小黑屋|安卓客户端|iOS客户端|Archiver|备用网址1|备用网址2|在线留言|专门网

返回顶部