China DOS Union

-- Unite DOS · Advance DOS · Grow DOS --

Union site: www.cn-dos.net Forum site: www.cn-dos.net/forum
DOS stands for freedom, openness and progress. Let us work hard, learn from the openness and GNU spirit of FreeDOS and Linux, and together build and grow a free GNU GPL world!

中国DOS联盟论坛
The time now is 2026-06-22 02:16
中国DOS联盟论坛 » DOS批处理 & 脚本技术(批处理室) » How to represent a progress status with "\-/"? DigestI View 24,456 Replies 57
Floor 31 Posted 2006-11-02 01:33 ·  中国 上海 漕河泾科技网IDC机房
新手上路
Credits 9
Posts 5
Joined 2006-10-11 05:17
19-year member
UID 65272
Status Offline
Replaced . with ▌


@echo off
setlocal enabledelayedexpansion
set b=/-\ /-\ **
set 速度=1
set 退格=
:b
for /l %%i in (0,1,200) do call :a %%i
goto :b
:a
set/a a=%1%%10
set/a c=%a%%%4
if %a% EQU 0 set/p=▌<nul
if %c% EQU 3 (set/p=^|<nul) else (set/p=!b:~%a%,1!<nul)
ping/n %速度% 127.1>nul
set/p=%退格%<nul
goto :eof

Floor 32 Posted 2006-11-02 02:05 ·  中国 广东 茂名 电信
中级用户
★★
Credits 261
Posts 123
Joined 2006-06-06 19:23
20-year member
UID 56648
Status Offline
Originally posted by kawakumo at 2006-11-1 13:58:
How to control if this effect is used to represent progress? For example, display the progress of copying files.


This is the real problem
I just want to know, for example, to display the progress when copying files, no need for progress correspondence, just display it, and the progress will not be displayed after copying is completed.
Floor 33 Posted 2006-11-03 20:41 ·  中国 福建 泉州 石狮市 电信
银牌会员
★★★
Credits 1,276
Posts 469
Joined 2002-12-23 13:00
23-year member
UID 586
Gender Male
From 福建泉州
Status Offline
The effect is not very good. Running this will copy c:\windows\*.* to the current directory and display the progress.


  1. @echo off
  2. setlocal enabledelayedexpansion
  3. set b=/-\ /-\ **
  4. set 速度=1
  5. set 退格=
  6. set n=0

  7. for %%i in (%SystemRoot%\*.*) do (call :a !n!&copy %%i>nul 2>nul&set /a n+=1)
  8. goto :eof

  9. :a
  10. set/a a=%1%%10
  11. set/a c=%a%%%4
  12. if %a% EQU 0 set/p=▌<nul
  13. if %c% EQU 3 (set/p=^|<nul) else (set/p=!b:~%a%,1!<nul)
  14. ping/n %速度% 127.1>nul
  15. set/p=%退格%<nul
  16. goto :eof
chenall posted on: 2006-11-03 08:37


[ Last edited by chenall on 2006-11-3 at 08:46 PM ]
Recent Ratings for This Post ( 2 in total) Click for details
RaterScoreTime
redtek +4 2006-11-04 03:48
jiangnan110 -2 2007-06-08 20:15
QQ:366840202
http://chenall.net
Floor 34 Posted 2006-11-04 08:33 ·  中国 上海 华为云
初级用户
Credits 32
Posts 9
Joined 2006-10-30 15:04
19-year member
UID 68888
Gender Male
Status Offline
That's really great, impressive!
Floor 35 Posted 2006-11-10 00:41 ·  IANA 局域网IP(Private-Use)
初级用户
Credits 34
Posts 13
Joined 2006-07-20 19:11
19-year member
UID 58929
Gender Male
Status Offline
I also come to improve, display a progress loop with vertical lines, heh!

@echo off
setlocal enabledelayedexpansion
set b=^|/-\
set 速度=1
set 退格=
:b
for /l %%i in (0,1,200) do call :a %%i
goto :b
:a
set/a a=%1%%4
set/p=!b:~%a%,1!<nul
ping/n %速度% 127.1>nul
set/p=%退格%<nul
goto :eof
Recent Ratings for This Post ( 1 in total) Click for details
RaterScoreTime
redtek +2 2006-11-11 03:19
Floor 36 Posted 2006-11-19 07:43 ·  中国 江苏 常州 溧阳市 电信
银牌会员
★★★
Credits 2,404
Posts 946
Joined 2005-09-08 13:44
20-year member
UID 42345
Status Offline
Can the progress loop be positioned in a specific location on the screen by oneself?
Floor 37 Posted 2006-11-23 06:43
中级用户
★★
DOS之日
Credits 337
Posts 161
Joined 2006-11-04 05:27
19-year member
UID 69523
Gender Male
Status Offline
Learning
for /f %%h in (`echo hxuan`) do for /f %%x in (`echo hxuan`) do if %%h==%%x nul
Floor 38 Posted 2006-12-14 00:41 ·  中国 湖南 永州 电信
初级用户
Credits 56
Posts 20
Joined 2006-04-23 12:47
20-year member
UID 54313
Status Offline
The demonstration on floor 33 shows the situation of file copying, taking the number of copied files as the step size. What if only copying one relatively large file (>=500m)? It would be nice if the progress bar could be synchronized with the called subroutine.
Floor 39 Posted 2007-03-02 16:30 ·  中国 广东 茂名 电信
新手上路
Credits 18
Posts 6
Joined 2007-03-02 16:10
19-year member
UID 80575
Gender Male
Status Offline
nb doesn't like using ping to control latency, uses

for /l %%i in (1,1,1000) do echo %%i>nul instead

[ Last edited by a11yesno on 2007-3-2 at 04:36 AM ]
Floor 40 Posted 2007-03-03 04:35 ·  中国 安徽 马鞍山 电信
中级用户
★★
Credits 493
Posts 228
Joined 2007-02-16 00:38
19-year member
UID 79596
Gender Male
From 安徽
Status Offline
chenall:
for %%i in (%SystemRoot%\*.*) do (call :a !n!&copy %%i>nul 2>nul&set /a n+=1)

Can't see clearly!
Why??? (%SystemRoot%\*.*)

set/a a=%1%%10
Is it %1 divided by 10 and take the remainder?

set/a c=%a%%%4
Is it %a% divided by 4 and take the remainder?

&copy %%i>nul
Harmful!!!

Fortunately, you didn't
&del %%i>nul
That would be terrible!

[ Last edited by xycoordinate on 2007-3-2 at 03:49 PM ]
Recent Ratings for This Post ( 1 in total) Click for details
RaterScoreTime
jiangnan110 +1 2007-06-08 20:16
Floor 41 Posted 2007-03-03 07:11 ·  中国 浙江 绍兴 电信
高级用户
★★★
Autowalk
Credits 845
Posts 375
Joined 2007-03-03 01:58
19-year member
UID 80606
Gender Male
Status Offline
It really started spinning, -_-! It's really powerful!
Floor 42 Posted 2007-03-12 06:52 ·  中国 北京 海淀区 IDC机房
初级用户
☆流星雨◇帅气冲天狂
Credits 24
Posts 21
Joined 2007-03-09 08:10
19-year member
UID 81176
Gender Male
From 广东
Status Offline
Develop the good habit of reading and replying to posts
Floor 43 Posted 2007-04-17 02:21 ·  中国 上海 长宁区 电信
初级用户
Credits 38
Posts 15
Joined 2007-04-13 20:38
19-year member
UID 85037
Gender Male
Status Offline
Wahaha
Floor 44 Posted 2007-04-17 03:08 ·  中国 广东 广州 教育网
铂金会员
★★★★
C++启程者
Credits 5,154
Posts 1,827
Joined 2003-07-18 00:00
22-year member
UID 7105
Gender Male
Status Offline
Well, the way to get ASCII control characters is pretty good, quite enjoyable..
But if you just want to get the 0x08 character, can you just enter 08 with a hex editor?
Floor 45 Posted 2007-04-17 04:35 ·  中国 广东 深圳 南山区 电信
新手上路
Credits 4
Posts 2
Joined 2007-04-10 06:55
19-year member
UID 84585
Gender Male
Status Offline
It's a big deal! The effect of the brother on the sixth floor is good, but it just looks uncomfortable
Forum Jump: