中国DOS联盟论坛

China DOS Union

-- Unite DOS · Advance DOS · Grow DOS --
Union site: www.cn-dos.net Forum site: www.cn-dos.net/forum
Guest | Log in | Register | Members | Search | China DOS Union
中国DOS联盟论坛
The time now is 2026-08-03 04:34
48,038 topics / 350,123 posts / today 1 new / 48,251 members
DOS批处理 & 脚本技术(批处理室) » How to do CD copying programs?
Printable Version  2,140 / 18
Floor1 tuesposo Posted 2007-01-11 21:59
初级用户 Posts 28 Credits 68
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 ]
Floor2 ccwan Posted 2007-01-12 01:41
金牌会员 Posts 1,160 Credits 2,725 From 河北廊坊
My CD drive is I, and the files are copied to h:\5.

The code is as follows:



The display result is:


[ Last edited by ccwan on 2007-1-12 at 01:49 AM ]
Floor3 lxmxn Posted 2007-01-12 01:54
版主 Posts 4,938 Credits 11,386

  Your batch script is quite good, add points.

Floor4 tuesposo Posted 2007-01-12 05:42
初级用户 Posts 28 Credits 68
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 ]
Floor5 ccwan Posted 2007-01-12 05:53
金牌会员 Posts 1,160 Credits 2,725 From 河北廊坊
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.
Floor6 lotus516 Posted 2007-01-12 05:55
高级用户 Posts 246 Credits 551
This is not bad for making an index!!
Floor7 tuesposo Posted 2007-01-12 05:55
初级用户 Posts 28 Credits 68
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?
Floor8 ccwan Posted 2007-01-12 06:04
金牌会员 Posts 1,160 Credits 2,725 From 河北廊坊
There are many ways in the forum about creating files named with date and time. You can search for it.
Floor9 tuesposo Posted 2007-01-12 21:44
初级用户 Posts 28 Credits 68
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.
Floor10 ccwan Posted 2007-01-12 21:55
金牌会员 Posts 1,160 Credits 2,725 From 河北廊坊
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.
Floor11 tuesposo Posted 2007-01-12 22:09
初级用户 Posts 28 Credits 68
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?
Floor12 ccwan Posted 2007-01-12 22:36
金牌会员 Posts 1,160 Credits 2,725 From 河北廊坊
I think it's because of floating - point operation problems. But it doesn't affect use and display, and it can be shielded.


The above sentence is changed to this:
Floor13 tuesposo Posted 2007-01-12 22:48
初级用户 Posts 28 Credits 68
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?
Floor14 ccwan Posted 2007-01-12 22:51
金牌会员 Posts 1,160 Credits 2,725 From 河北廊坊
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?
Floor15 tuesposo Posted 2007-01-12 22:56
初级用户 Posts 28 Credits 68
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.
1 2  Next
[ Contact the Union admin team - 中国DOS联盟 - Standard version ]
Sponsored by ifanr Inc | © 2001–2023