|
tuesposo
初级用户
 
积分 68
发帖 28
注册 2006-12-29
状态 离线
|
『楼 主』:
光盘复制程序如何搞啊?
使用 LLM 解释/回答一下
1.插入光盘后,运行此程序,能把光盘上所有东西拷贝进硬盘上的1个路径
2.自动检查这个路径内新拷贝的东西,把*.bak文件都删掉
3.产生1个txt文件或网页文件里边记录刚刚拷贝东西有多少容量(精确到Mb),共多少个文件,如果有个象树型结构一样的东西显示里边内容东西那就更好了
谢谢哪位高手兄弟帮帮忙啊
Last edited by namejm on 2007-1-11 at 05:03 PM ]
1. After inserting the CD, run this program, which can copy all the contents on the CD into one path on the hard disk.
2. Automatically check the newly copied things in this path and delete all *.bak files.
3. Generate a txt file or web page file that records the capacity of the just - copied things (precise to Mb), the total number of files. It would be even better if there is something like a tree - like structure to display the contents inside.
Thank you, any expert brother, help me out.
Last edited by namejm on 2007 - 1 - 11 at 05:03 PM ]
|
|
2007-1-11 21:59 |
|
|
ccwan
金牌会员
     
积分 2725
发帖 1160
注册 2006-9-23 来自 河北廊坊
状态 离线
|
『第 2 楼』:
使用 LLM 解释/回答一下
我的光驱为 I ,文件复制到 h:\5 下
代码如下:
@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/s ^|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
显示结果为:
8个文件 30MB
H:\5
│ DI-604.mbd
│ autorun.exe
│ autorun.inf
│
├─Acrobat
│ AdbeRdr60_enu_full.exe
│
├─Manual
│ di604_man_revx_ger_161204.pdf
│ di604_manual_205.pdf
│
└─Quick Installation Guide
di-604_manual_203_DE.pdf
di604_QIG_205.pdf
Last edited by ccwan on 2007-1-12 at 01:49 AM ]
My CD drive is I, and the files are copied to h:\5.
The code is as follows:
@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/s ^|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
The display result is:
8 files 30MB
H:\5
│ DI-604.mbd
│ autorun.exe
│ autorun.inf
│
├─Acrobat
│ AdbeRdr60_enu_full.exe
│
├─Manual
│ di604_man_revx_ger_161204.pdf
│ di604_manual_205.pdf
│
└─Quick Installation Guide
di-604_manual_203_DE.pdf
di604_QIG_205.pdf
Last edited by ccwan on 2007-1-12 at 01:49 AM ]
此帖被 +4 点积分 点击查看详情 评分人:【 lxmxn 】 | 分数: +4 | 时间:2007-1-12 01:54 |
|
|

三人行,必有吾师焉。 学然后知不足,教然后知困,然后能自强也。 |
|
2007-1-12 01:41 |
|
|
lxmxn
版主
       
积分 11386
发帖 4938
注册 2006-7-23
状态 离线
|
『第 3 楼』:
使用 LLM 解释/回答一下
兄的批处理不错啊,加分。
Your batch script is quite good, add points.
|
|
2007-1-12 01:54 |
|
|
tuesposo
初级用户
 
积分 68
发帖 28
注册 2006-12-29
状态 离线
|
『第 4 楼』:
使用 LLM 解释/回答一下
谢谢斑竹我会尽快改的
谢谢2楼兄,可是好象容量显示不正确,我从文件属性里看到是290MB,但是1.txtl里是304M为什么啊?
还有如果bak是隐藏文件能删吗
Last edited by tuesposo on 2007-1-11 at 04:45 PM ]
Thanks, moderator. I will correct it as soon as possible.
Thanks, brother on the 2nd floor. But it seems that the capacity display is incorrect. I saw from the file properties that it is 290MB, but in 1.txtl it is 304M. Why?
Also, if bak is a hidden file, can it be deleted?
Last edited by tuesposo on 2007-1-11 at 04:45 PM ]
|
|
2007-1-12 05:42 |
|
|
ccwan
金牌会员
     
积分 2725
发帖 1160
注册 2006-9-23 来自 河北廊坊
状态 离线
|
『第 5 楼』:
使用 LLM 解释/回答一下
容量本就是约数,不会太准,不然你试试改成 size=%%k/1049000 看行不行。
del加上参数就可以了,del/a/f/q 应该够用了。
Capacity is just an approximate number and won't be too accurate. Otherwise, you can try changing it to size=%%k/1049000 to see if it works. The del command can be used with parameters, and del/a/f/q should be sufficient.
|

三人行,必有吾师焉。 学然后知不足,教然后知困,然后能自强也。 |
|
2007-1-12 05:53 |
|
|
lotus516
高级用户
    论坛上抢劫的
积分 551
发帖 246
注册 2006-9-21
状态 离线
|
『第 6 楼』:
使用 LLM 解释/回答一下
这个用来作索引还不错!!
This is not bad for making an index!!
|
|
2007-1-12 05:55 |
|
|
tuesposo
初级用户
 
积分 68
发帖 28
注册 2006-12-29
状态 离线
|
『第 7 楼』:
使用 LLM 解释/回答一下
谢谢哦,还有能不要叫1.txt吗?txt文件名就是拷贝当天的时间如2006-05-13.txt,如果能精确到时间更好了2006-05-13(16:52).txt,能有这个功能吗?
Thanks. Also, can the file name not be 1.txt? The txt file name should be the time of the copy day, like 2006-05-13.txt. It would be better if it can be precise to the time, like 2006-05-13(16:52).txt. Can this function be available?
|
|
2007-1-12 05:55 |
|
|
ccwan
金牌会员
     
积分 2725
发帖 1160
注册 2006-9-23 来自 河北廊坊
状态 离线
|
『第 8 楼』:
使用 LLM 解释/回答一下
关于建立以日期、时间为名称的文件,坛子里有很多法子了,你可以搜一下。
There are many ways in the forum about creating files named with date and time. You can search for it.
|

三人行,必有吾师焉。 学然后知不足,教然后知困,然后能自强也。 |
|
2007-1-12 06:04 |
|
|
tuesposo
初级用户
 
积分 68
发帖 28
注册 2006-12-29
状态 离线
|
『第 9 楼』:
使用 LLM 解释/回答一下
哥哥时间问题搞好了,就是容量如何显示呢?就是说点鼠标右键出来的文件容量,而不是从字节转出来的文件容量啊
The time issue has been resolved, but how to display the capacity? I mean the file capacity shown when you right-click the mouse, not the file capacity converted from bytes.
|
|
2007-1-12 21:44 |
|
|
ccwan
金牌会员
     
积分 2725
发帖 1160
注册 2006-9-23 来自 河北廊坊
状态 离线
|
『第 10 楼』:
使用 LLM 解释/回答一下
Originally posted by tuesposo at 2007-1-12 21:44:
哥哥时间问题搞好了,就是容量如何显示呢?就是说点鼠标右键出来的文件容量,而不是从字节转出来的文件容量啊
这句话挺难读懂。
其实右键属性中的容量也是以字节为基本单位的,所谓的MB同样是从字节运算而来。
Originally posted by tuesposo at 2007-1-12 21:44:
The elder brother, the time problem is fixed. But how to display the capacity? I mean the file capacity shown when right-clicking the mouse, not the file capacity converted from bytes.
This sentence is quite hard to understand.
Actually, the capacity in the right-click properties is also based on the byte as the basic unit. The so-called MB is also calculated from bytes.
|

三人行,必有吾师焉。 学然后知不足,教然后知困,然后能自强也。 |
|
2007-1-12 21:55 |
|
|
tuesposo
初级用户
 
积分 68
发帖 28
注册 2006-12-29
状态 离线
|
『第 11 楼』:
使用 LLM 解释/回答一下
哥哥我在程序最后面加了个pause,程序不会自动关闭,为什么出现下面的内容啊:
无效数字。数字常数只能是十进制(17),十六进制(0x11)或八进制(021)是哪行出问题了啊?
Brother, I added a pause at the end of the program, and the program doesn't close automatically. Why do I get the following content?
Invalid number. Numeric constants can only be decimal (17), hexadecimal (0x11) or octal (021). Which line is the problem?
|
|
2007-1-12 22:09 |
|
|
ccwan
金牌会员
     
积分 2725
发帖 1160
注册 2006-9-23 来自 河北廊坊
状态 离线
|
『第 12 楼』:
使用 LLM 解释/回答一下
我想是因为浮点运算问题吧。但并不影响使用和显示,可以屏蔽掉。
set a=%%i&set b=%%j&(if not "%%k"=="" set/a size=%%k/1048576)
上面这句改成这样:
set a=%%i&set b=%%j&(if not "%%k"=="" set/a size=%%k/1048576) 2>nul
I think it's because of floating - point operation problems. But it doesn't affect use and display, and it can be shielded.
set a=%%i&set b=%%j&(if not "%%k"=="" set/a size=%%k/1048576)
The above sentence is changed to this:
set a=%%i&set b=%%j&(if not "%%k"=="" set/a size=%%k/1048576) 2>nul
|

三人行,必有吾师焉。 学然后知不足,教然后知困,然后能自强也。 |
|
2007-1-12 22:36 |
|
|
tuesposo
初级用户
 
积分 68
发帖 28
注册 2006-12-29
状态 离线
|
『第 13 楼』:
使用 LLM 解释/回答一下
嘎嘎,问题解决了,:P:D:lol:谢谢哦,但还有个小问题,我拿字节数除1048576,除出来2者结果也不对啊,相差10多M,会不会是字节数不对啊
Gaga, the problem is solved, :P:D:lol: Thank you, but there's still a small problem. I divided the number of bytes by 1048576, and the result is also incorrect. There's a difference of more than 10MB. Could it be that the number of bytes is incorrect?
|
|
2007-1-12 22:48 |
|
|
ccwan
金牌会员
     
积分 2725
发帖 1160
注册 2006-9-23 来自 河北廊坊
状态 离线
|
『第 14 楼』:
使用 LLM 解释/回答一下
那你的文件到底多少字节呢?
有没有试过我在5楼说的用1049000试试?
试过后把结果贴出来看看好吗?
Then, how many bytes is your file exactly? Have you tried using 1049000 as I mentioned on the 5th floor? After trying, please post the result for us to see, okay?
|

三人行,必有吾师焉。 学然后知不足,教然后知困,然后能自强也。 |
|
2007-1-12 22:51 |
|
|
tuesposo
初级用户
 
积分 68
发帖 28
注册 2006-12-29
状态 离线
|
『第 15 楼』:
使用 LLM 解释/回答一下
都试过啊
文件属性里显示是304,880,027字节,大小是290M,用304,880,027除
1048576是290.756。
但是1.txt里是304Mb,文件个数和文件属性里的个数一样都是879个啊
I've tried everything.
The file properties show 304,880,027 bytes, and the size is 290M. Dividing 304,880,027 by 1048576 gives 290.756.
But 1.txt says 304Mb, and the number of files is the same as in the file properties, which is 879.
|
|
2007-1-12 22:56 |
|