中国DOS联盟论坛

中国DOS联盟

-- 联合DOS 推动DOS 发展DOS --

联盟域名:www.cn-dos.net  论坛域名:www.cn-dos.net/forum
DOS,代表着自由开放与发展,我们努力起来,学习FreeDOS和Linux的自由开放与GNU精神,共同创造和发展美好的自由与GNU GPL世界吧!

游客:  注册 | 登录 | 命令行 | 会员 | 搜索 | 上传 | 帮助 »
中国DOS联盟论坛 » DOS批处理 & 脚本技术(批处理室) » 垃圾删除与进度条"精确"同步实例
作者:
标题: 垃圾删除与进度条"精确"同步实例 上一主题 | 下一主题
sncffihc
初级用户





积分 51
发帖 17
注册 2008-9-3
状态 离线
『楼 主』:  垃圾删除与进度条"精确"同步实例

一直想在这个论坛找一个垃圾删除与进度条"精确"同步实例。但进度条的例子大把的有,但和进度条同步的同乎没有,我变换一下思路,超级简单,供大家参考。有不科学之处请指出。希望有更好的思路。 @echo off mode con cols=90 lines=5 &color 9f echo ┌──────────────────────────────────────────┐ for /l %%a in (1,1,22) do call :%%a &set /p a=■■<nul echo 清理完成...请按任意键退出! & pause >nul goto:eof :1 del /a /f /s /q "%userprofile%\Locals~1\History\*.*" >nul 2>nul goto:eof :2 rd/s/q "%userprofile%\Locals~1\Tempor~1\Content.IE5\">nul 2>nul goto:eof :3 rd/s/q "%userprofile%\Locals~1\Temp\">nul 2>nul goto:eof :4 del /a /f /s /q "%userprofile%\Locals~1\Tempor~1\*.*" >nul 2>nul goto:eof :5 del /a /f /s /q "%userprofile%\Locals~1\Temp\*.*" >nul 2>nul goto:eof :6 del /a /f /s /q "%userprofile%\cookies\*.*" >nul 2>nul goto:eof :7 del /a /f /s /q "%userprofile%\recent\*.*">nul 2>nul goto:eof :8 del /a /f /s /q "%Temp%\*.*">nul 2>nul goto:eof :9 del /a /f /s /q "%Tmp%\*.*" >nul 2>nul goto:eof :10 rd /s /q "%SystemRoot%\Downloaded Program Files" >nul 2>nul goto:eof :11 rd /s /q "%SystemRoot%\SoftwareDistribution\Download" >nul 2>nul goto:eof :12 rd /s /q "%SystemRoot%\system32\ReinstallBackups" >nul 2>nul goto:eof :13 del /a /f /s /q "%SystemRoot%\Prefetch\*.*" >nul 2>nul goto:eof :14 del /a /f /s /q "%SystemRoot%\minidump\*.*" >nul 2>nul goto:eof :15 del /f /s /q %windir%\prefetch\*.* >nul 2>nul goto:eof :16 rd /s /q %windir%\temp >nul 2>nul& md %windir%\temp >nul 2>nul goto:eof :17 del /f /q %userprofile%\COOKIES s\*.* >nul 2>nul goto:eof :18 del /f /q %userprofile%\recent\*.* >nul 2>nul goto:eof :19 del /f /s /q "%userprofile%\Local Settings\Temporary Internet Files\*.*" >nul 2>nul goto:eof :20 del /f /s /q "%userprofile%\Local Settings\Temp\*.*" >nul 2>nul goto:eof :21 rd/s/q "C:\Documents and Settings\sn.T\Local Settings\History\History.IE5\" >nul 2>nul goto:eof :22 del /f /s /q "%userprofile%\recent\*.*" >nul 2>nul goto:eof


   此帖被 +7 点积分      点击查看详情   
评分人:【 s11ss 分数: +7  时间:2008-12-8 16:25


2008-12-8 14:28
查看资料  发送邮件  发短消息 网志   编辑帖子  回复  引用回复
HAT
版主





积分 9023
发帖 5017
注册 2007-5-31
状态 离线
『第 2 楼』:  

Q: 为方便他人复制,如何给代码加code标签? A: www.cn-dos.net/forum ... 参考:www.cn-dos.net/forum ...




2008-12-8 14:41
查看资料  发短消息 网志   编辑帖子  回复  引用回复
zh159
金牌会员




积分 3687
发帖 1467
注册 2005-8-8
状态 离线
『第 3 楼』:  

这样更好:
@echo off
mode con cols=90 lines=5 &color 9f
echo ┌──────────────────────────────────────────┐
del /a /f /s /q "%userprofile%\Locals~1\History\*.*" >nul 2>nul
call :loop
rd/s/q "%userprofile%\Locals~1\Tempor~1\Content.IE5\">nul 2>nul
call :loop
rd/s/q "%userprofile%\Locals~1\Temp\">nul 2>nul
call :loop
......
pause
exit

:loop
set /p a=■■<nul
goto :eof




2008-12-8 16:52
查看资料  发短消息 网志   编辑帖子  回复  引用回复

请注意:您目前尚未注册或登录,请您注册登录以使用论坛的各项功能,例如发表和回复帖子等。


可打印版本 | 推荐给朋友 | 订阅主题 | 收藏主题



论坛跳转: