Board logo

标题: 加入进度条批处理不知能不能实现? [打印本页]

作者: sncffihc     时间: 2008-12-4 13:14    标题: 加入进度条批处理不知能不能实现?

本人有一个垃圾批处理。想改进一个加一进度条。并进度条和原来垃圾批处理是同步的。也就是说批处理完成时进度条也到了100%.
   本人的想法是在每条垃圾删除命令后面加一命令,执行完一条命令就累积一个■(小方块)。这们直观些。


本人已搞定!!供大家参考,不科学之处请指出。

@echo off
title 系统垃圾清除、、、
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

[ Last edited by sncffihc on 2008-12-8 at 14:41 ]
作者: ZJHJ     时间: 2008-12-6 08:40

@echo off
::qq251485609
::清除系统垃圾修改版.txt
@cls
echo.
echo         计算机在使用的过程中,会有很多操作记录档案或是安装临时文件等,这些我们
echo.
echo     已经不需要了的文件,时间长了会越积越多,占据空间或影响速度。现在可运行自动
echo.
echo     清除!免去你手动出错的烦恼。随时保持一个清洁的系统!
echo.
echo.
@set /p FSYGJI=     是否确认清除?( Y/N )
@if "%FSYGJI%"=="N" goto EOF
cls
@echo off
echo.
echo  正在清除垃圾文件,请稍等......
echo ─────────────
Attrib -r -h -a -s %systemdrive%\*.tmp>nul 2>nul
del /f /s /q %systemdrive%\*.tmp>nul 2>nul
call :jdt
Attrib -r -h -a -s %systemdrive%\*._mp>nul 2>nul
del /f /s /q %systemdrive%\*._mp>nul 2>nul
call :jdt
Attrib -r -h -a -s %systemdrive%\*.gid>nul 2>nul
del /f /s /q %systemdrive%\*.gid>nul 2>nul
call :jdt
Attrib -r -h -a -s %systemdrive%\*.chk>nul 2>nul
del /f /s /q %systemdrive%\*.chk>nul 2>nul
call :jdt
Attrib -r -h -a -s %systemdrive%\*.old>nul 2>nul
del /f /s /q %systemdrive%\*.old>nul 2>nul
call :jdt
Attrib -r -h -a -s %systemdrive%\recycled\*.*>nul 2>nul
del /f /s /q %systemdrive%\recycled\*.*>nul 2>nul
call :jdt
Attrib -r -h -a -s %windir%\prefetch\*.*>nul 2>nul
del /f /s /q %windir%\prefetch\*.*>nul 2>nul
call :jdt
del /f /s /q %windir%\temp\*.*>nul 2>nul
call :jdt
Attrib -r -h -a -s "%userprofile%\Local Settings\Temporary Internet Files\*.*">nul 2>nul
del /f /s /q "%userprofile%\Local Settings\Temporary Internet Files\*.*">nul 2>nul
call :jdt
Attrib -r -h -a -s "%userprofile%\Local Settings\Temp\*.*">nul 2>nul
del /f /s /q "%userprofile%\Local Settings\Temp\*.*">nul 2>nul
call :jdt
Attrib -r -h -a -s "%userprofile%\recent\*.*">nul 2>nul
del /f /s /q "%userprofile%\recent\*.*">nul 2>nul
call :jdt
Attrib -r -h -a -s "%systemroot%\system32\spool\printers\*.*">nul 2>nul
del /f /s /q "%systemroot%\system32\spool\printers\*.*">nul 2>nul
call :jdt
Attrib -r -h -a -s "%systemroot%\Installer\*.MSP">nul 2>nul
del /f /s /q "%systemroot%\Installer\*.MSP">nul 2>nul
call :jdt
echo.
echo    清除系统垃圾文件已完成!
echo.
@echo  
ping 127.1 /n 4 >nul
goto eof
:jdt
set /p a=■<nul
goto :eof
[ Last edited by ZJHJ on 2008-12-13 at 22:59 ]
作者: nmycj     时间: 2009-7-29 22:09
楼上的“@echo  ”是做什么的?我的机子上加入这个主板会嘀的一声,去掉就没了