[新手上路]批处理新手入门导读[视频教程]批处理基础视频教程[视频教程]VBS基础视频教程[批处理精品]批处理版照片整理器
[批处理精品]纯批处理备份&还原驱动[批处理精品]CMD命令50条不能说的秘密[在线下载]第三方命令行工具[在线帮助]VBScript / JScript 在线参考
返回列表 发帖

[文本处理] 用批处理怎么实现进度条显示?

好像是用 set 和 for 来实现。

实现功能:
显示解压文件进度,解压好一个文件后,进度条清零,继续解压下个文件,进度条从头开始。
能解压多个文件的。。
最好是再有个总进度就最好了。。
求解,上次在坛子里看到这个功能,调试不好了,求高人指导啊!

木人回到吗~~~~?????

TOP

我有个模块~
自己写地~
有点乱~
地址:http://garyngzhongbo.blogspot.com/2011/10/bat.html

TOP

回复 3# garyng




打不开饿饿饿饿饿饿~~~~

TOP

啊~
这么会啊?!

算了啦 ==

源代码(有点乱。。)
  1. @echo off
  2. setlocal enabledelayedexpansion
  3. color 0a
  4. mode con: cols=80 lines=30
  5. title Code By GaryNg--Loading Bar Module
  6. set "clr=set bk="
  7. set "kuang=set /p=[                                        ]<nul"
  8. set "ping=ping -n 1 127.1 >nul 2>nul"
  9. set "done=set /p=]Done<nul&echo\"
  10. set "kuang1=set /p=[::::::::::::::::::::::::::::::::::::::::]<nul"
  11. ::1
  12. echo\&echo 1: An Easy Loading Bar&echo\&echo\&echo\&echo\
  13. %kuang%
  14. call :BK 40
  15. set /p=!bk!^|<nul
  16. for /l %%i in (1 1 39) do (
  17. set /p=^|<nul
  18. %ping%
  19. )
  20. %done%
  21. pause
  22. cls
  23. ::2
  24. echo\&echo 2: Sliding Loading Bar&echo\&echo\&echo\&echo\
  25. %kuang%
  26. call :BK 36
  27. set /p=!bk!^<==^><nul
  28. %ping%
  29. call :BK 3
  30. for /l %%i in (1 1 32) do (
  31. set /p=!bk! ^<==^><nul
  32. %ping%
  33. )
  34. %done%
  35. pause
  36. cls
  37. ::3
  38. echo\&echo 3: Go and Back Loading Bar&echo\&echo\&echo\&echo\
  39. %kuang%
  40. call :BK 36
  41. set /p=!bk!%cur%<nul
  42. %ping%
  43. call :BK 3
  44. for /l %%i in (1 1 36) do (
  45. set /p=!bk! ^<==^><nul
  46. %ping%
  47. )
  48. call :BK 5
  49. set /p=!bk!^<==^>  <nul
  50. %ping%
  51. for /l %%i in (1 1 35) do (
  52. set /p=!bk!^<==^> <nul
  53. %ping%
  54. )
  55. set /p=                                   ]Done<nul
  56. echo\
  57. pause
  58. cls
  59. ::4
  60. echo\&echo 4: Spining Loading&echo\&echo\&echo\&echo\
  61. %kuang%
  62. call :BK 40
  63. set /p=!bk!<nul
  64. %clr%
  65. set b=/-\ /-\ **
  66. :b
  67. for /l %%i in (0,1,390) do call :a %%i
  68. goto :c
  69. :a
  70. set/a a=%1%%10
  71. set/a c=%a%%%4
  72. if %a% EQU 0 set/p=.<nul
  73. if %c% EQU 3 (set/p=^|<nul) else (set/p=!b:~%a%,1!<nul)
  74. set/p=!bk!<nul
  75. goto :eof
  76. :c
  77. %done%
  78. pause
  79. cls
  80. ::5
  81. echo\&echo 5: Backward Loading Bar&echo\&echo\&echo\&echo\
  82. %clr%
  83. %kuang%
  84. set bk=!bk!
  85. for /l %%i in (1 1 40) do (
  86. set /p=!bk!^|<nul
  87. %ping%
  88. )
  89. echo\
  90. echo Done
  91. pause
  92. cls
  93. ::6
  94. echo\&echo 6. "Under Tunnel" Loading Bar&echo\&echo\&echo\&echo\
  95. call :SP 40
  96. set /p=[!sp!]<nul
  97. call :BK 36
  98. set /p=!bk!<nul
  99. %ping%
  100. call :BK 3
  101. for /l %%i in (1 1 36) do (
  102. set /p=!bk! ::::<nul
  103. %ping%
  104. )
  105. call :BK 39
  106. call :SP 36
  107. set /p=!bk!:!sp!<nul
  108. %ping%
  109. call :BK 35
  110. call :SP 36
  111. for /l %%i in (1 1 3) do (
  112. %ping%
  113. set /p=!bk!:!sp!<nul
  114. )
  115. call :BK 35
  116. set /p=!bk!<nul
  117. call :BK 3
  118. for /l %%i in (1 1 36) do (
  119. set /p=!bk! ::::<nul
  120. %ping%
  121. )
  122. %done%
  123. pause
  124. cls
  125. ::7
  126. echo\&echo 7. Go Towards Center Loading Bar&echo\&echo\&echo\&echo\
  127. %kuang%
  128. for /l %%i in (1 1 20) do (
  129. set c=
  130. set s=
  131. set /a c=42-2*%%i
  132. set /a s=!c!-2
  133. call :BK !c!
  134. call :SP !s!
  135. set /p=!bk!^|!sp!^|<nul
  136. %ping%
  137. )
  138. set /p=Done<nul
  139. echo\
  140. pause
  141. cls
  142. ::8
  143. echo\&echo 8. Replace To Load&echo\&echo\&echo\&echo\
  144. %kuang1%
  145. call :BK 40
  146. set /p=!bk!^|<nul
  147. for /l %%i in (1 1 39) do (
  148. set /p=^|<nul
  149. %ping%
  150. )
  151. %done%
  152. pause&exit
  153. :SP
  154. set sp=
  155. for /l %%i in (1 1 %1) do (
  156. set sp=!sp!
  157. )
  158. goto :eof
  159. :BK
  160. %clr%
  161. for /l %%i in (1 1 %1) do (
  162. set bk=!bk!
  163. )
  164. goto :eof
复制代码

TOP

返回列表