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-08-03 03:28
中国DOS联盟论坛 » DOS批处理 & 脚本技术(批处理室) » How to do CD copying programs? View 2,135 Replies 18
Floor 16 Posted 2007-01-12 23:26 ·  中国 河北 廊坊 三河市 移动
金牌会员
★★★★
Credits 2,725
Posts 1,160
Joined 2006-09-23 12:00
19-year member
UID 63486
From 河北廊坊
Status Offline
I really don't understand this, hope some experts can explain it.
In addition, limited by the fact that the maximum value of numbers that batch processing can correctly handle is 65536*65536/2-1, that is 2147483647,
so when the file is too large, this batch processing can't display correctly either.
三人行,必有吾师焉。 学然后知不足,教然后知困,然后能自强也。
Floor 17 Posted 2007-01-12 23:28 ·  中国 上海 上海乾万网络(QianWan_Network)有限公司(电信出口)
初级用户
Credits 68
Posts 28
Joined 2006-12-29 00:55
19-year member
UID 74861
Gender Male
Status Offline
Small-capacity files seem to be correct, but large-capacity files are a bit worse. Still, thank you.
Floor 18 Posted 2007-01-12 23:45 ·  中国 河北 廊坊 三河市 移动
金牌会员
★★★★
Credits 2,725
Posts 1,160
Joined 2006-09-23 12:00
19-year member
UID 63486
From 河北廊坊
Status Offline
The reason has been found. Reminded by 9527, it turned out that it was because the parameter /-c was forgotten to be used. It is used to remove the delimiter, so the code is changed to

@echo off
md h:\5
xcopy/s/e/q i:\*.* h:\5>nul&cd/d h:\5
if exist *.bak del *.bak
for /f "tokens=1-4 delims= " %%i in ('dir/a/s/-c ^|find "文件"') do set a=%%i&set b=%%j&(if not "%%k"=="" set/a size=%%k/1048576)
echo %a%%b% %size%MB>c:\1.txt

for /f "skip=2 delims=" %%i in ('tree /f h:\5') do @echo. %%i>>c:\1.txt
start c:\1.txt
三人行,必有吾师焉。 学然后知不足,教然后知困,然后能自强也。
Floor 19 Posted 2007-01-13 00:06 ·  中国 上海 上海乾万网络(QianWan_Network)有限公司(电信出口)
初级用户
Credits 68
Posts 28
Joined 2006-12-29 00:55
19-year member
UID 74861
Gender Male
Status Offline
Now it's displayed correctly, thanks a lot to the two brothers ccwan and 9527!
Forum Jump: