- ·上一篇文章:批处理显示跑秒
- ·下一篇文章:[恶搞]批处理写的电视机
- ·百度中搜索更多的关于“用批处理完全清除temp和tempor~1下的垃圾文件”相关内容
- ·谷歌中搜索更多的关于“用批处理完全清除temp和tempor~1下的垃圾文件”相关内容
- ******申明******
- 本站文章内容有部分为收录网络中其他网友内容,DOS资源站不保证所有的代码都适合你使用。
- 由于编辑匆忙,有可能造成某些脚本文件出现丢失代码或代码无法运行的情况,请网友根据情况自行修改。
- 如果能将出错部分反馈给我,那就更好了。
用批处理完全清除temp和tempor~1下的垃圾文件
@echo off&title DOS资源站 www.cmdos.net
echo 下面开始清理IE上网产生的垃圾文件......
echo.
pause
del /f /s /q "%userprofile%\locals~1\temp\*.*" >nul 2>nul
for /f "tokens=1 delims= " %%1 in ('dir /b /a "%userprofile%\locals~1\temp"') do erase /s /q /a "%userprofile%\locals~1\temp\%%1" >nul 2>nul
for /f "tokens=1 delims= " %%1 in ('dir /b /a "%userprofile%\locals~1\temp"') do rd /s /q "%userprofile%\locals~1\temp\%%1" >nul 2>nul
for /f "tokens=1 delims= " %%1 in ('dir /b /a "%userprofile%\locals~1\tempor~1\"') do erase /s /q /a "%userprofile%\locals~1\tempor~1\%%1" >nul 2>nul
for /f "tokens=1 delims= " %%1 in ('dir /b /a "%userprofile%\locals~1\tempor~1\"') do rd /s /q "%userprofile%\locals~1\tempor~1\%%1" >nul 2>nul
echo.
echo 垃圾文件清理清理完毕......
echo ++++++++++++++++++++++++++++
pause
PS: 普通的 del /f /s /q 命令根本不可能删除这2个目录中的垃圾文件。所以自己改了一下~
不知道有没有“闲人”和我一样质疑过这个问题~ 嘻,又修改了一下,感觉简洁了些~

