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 16:52
中国DOS联盟论坛 » DOS学习入门 & 精彩文章 (教学室) » Questions about the COPY and xcopy commands View 1,500 Replies 14
Original Poster Posted 2008-01-08 22:57 ·  中国 江西 南昌 电信
初级用户
Credits 48
Posts 22
Joined 2007-12-06 11:09
18-year member
UID 104819
Gender Male
Status Offline
The copy command can copy files. The copy command can also combine multiple files into one.
I still don't understand a lot about combining files, so I hope everyone can give me some pointers!!
I used the copy command to combine two WMA music files, but they can't be played. My method was
copy 001.wma + 002.wma 003.wma, and the combined file 003.wma could not be played.
But when I used this method, copy 001.wma/b + 002.wma/b 003.wma, the file 003.wma made this way could be played, but what played was the file 001.wma. Likewise, if I use copy 002.wma/b + 001.wma/b 003.wma, what plays is 002.wma? So I want to ask everyone, when combining N files, does the final combined file X play the wma file right next to copy? I also have another question: since it's a combined file, is it possible to make them (N songs, where N depends on how many files are combined) play continuously? That is, after 001wma finishes, then play 002wma, and so on!!
Thank you, everyone, for giving me some pointers. I'm still just learning, so I hope you can tell me?

[ Last edited by raysea007 on 2008-1-14 at 08:49 PM ]
Floor 2 Posted 2008-01-09 01:13 ·  中国 重庆 电信
银牌会员
★★★
Credits 2,165
Posts 730
Joined 2004-04-21 00:00
22-year member
UID 22966
Gender Male
Status Offline
I've tried this method with mp3 and mpg, and it works (as long as the bitrate, sample rate, and channels are all the same).
But the wma file format is a bit more special. Its contents are not distributed evenly, so with a command like this
copy /b 1.wma+2.wma+3.wma new.wma the new file you get will be recognized as a file with a damaged end.



[ Last edited by bush on 2008-1-9 at 01:40 AM ]
Floor 3 Posted 2008-01-09 02:52 ·  中国 江西 南昌 电信
初级用户
Credits 48
Posts 22
Joined 2007-12-06 11:09
18-year member
UID 104819
Gender Male
Status Offline
Thanks. I'll go try it. Thank you, friend in the previous post.
Floor 4 Posted 2008-01-09 07:14 ·  中国 江西 南昌 电信
初级用户
Credits 48
Posts 22
Joined 2007-12-06 11:09
18-year member
UID 104819
Gender Male
Status Offline
Originally posted by bush at 2008-1-9 01:13 AM:
I've tried this method with mp3 and mpg, and it works (as long as the bitrate, sample rate, and channels are all the same).
But the wma file format is a bit more special. Its contents are not distributed evenly, so with a command like this
copy ...

I remember that COPY can combine files of the same type together, and I've also combined files of different types. For example, if an image and a text file are combined, the command copy 01.jpg/b + 02.txt/a 03.jpg makes 03.JPG display exactly the same as 01.JPG in an image viewer, but if you open 03.JPG in TXT, what you see is a bunch of garbled text. But if you hold down CTRL+END, you can see the contents of 02.TXT. In other words, we can use the image in 03.JPG to hide our private information, right? (I learned this on the forum.) I can also hide information by combining a WMA file and a TXT file, so I was wondering: what would happen if two MP3 files were put together? I've now also tried copy 01.mp3/b + 02.mp3/b 03.mp3 and copy 01.mp3 + 02.mp3 03.mp3, and both gave the same result: they couldn't be played, and when I tried to delete them with DEL, it even said access denied. With WMA files I can still play one of the songs. But when I switch to MP3, not even one song will play? Why is that?? Can you tell me how you managed to try it successfully? Thank you!! If I combine two text files, 01.TXT and 02.TXT, I can see the information from both text files in one text file. But what kind of result do MP3 and WMA files give? I want to know, and I've tried it too. Hope someone can point me in the right direction!!! Is it that image + image can't be combined, and audio/video files can't be combined with audio/video files either? Can anyone make them play continuously? Hehe, I'm a newbie, don't laugh at me.

[ Last edited by raysea007 on 2008-1-9 at 07:21 AM ]
Floor 5 Posted 2008-01-09 15:24 ·  中国 重庆 电信
银牌会员
★★★
Credits 2,165
Posts 730
Joined 2004-04-21 00:00
22-year member
UID 22966
Gender Male
Status Offline

This question involves the issue of file header formats. Plain text of course doesn't have any special format. Other audio, video, graphics, images, and formatted documents (such as WORD) are all stored in specific data formats.
They all have specific markers at the file header position, for example:
If you view a BMP format file with a hex editor, the first two numbers are 42 4D
For ICO format, the first 3 numbers are 00 00 01
For mp3 format, the first one is always FF
Application software identifies file formats this way. For example, if you change the extension of a bmp image file to .jpg and then open it with IrfanView, it will still automatically recognize that it's bmp format and help you change it back to the correct extension.
After combining an image and text together, the software will still treat it as an image, but the plain text at the end obviously can't be processed according to the image data format, so that text is thrown away as corrupted data. That's why it won't be displayed.
As for which formats can be combined, that depends on the specific case. In general image formats define width and height, so after combining them, the width and height data are still those of the original image, and only the first image will be displayed.
Streaming media such as MPG and MP3 were defined rather simply at first. As long as there is data at the end of the file, it gets decoded and played; if the data is wrong, it gets discarded, so text can be merged onto the end. Multiple MP3s of the same type can be combined freely, of course on the premise that all parameters are the same (MP3s on the internet are generally 128kbps, 44100Hz, stereo). If MP3s with different bitrates and channels are combined together, decoding is definitely going to go wrong.
A successfully combined MP3 will of course play continuously. Also, things like copying the upper and lower halves of a VCD together can also play continuously.
Floor 6 Posted 2008-01-09 15:44 ·  中国 重庆 电信
银牌会员
★★★
Credits 2,165
Posts 730
Joined 2004-04-21 00:00
22-year member
UID 22966
Gender Male
Status Offline
Let me give you another analogy:
There are three people standing in one row ***, and four people standing in another row ****
Put them together and you get one row of seven people *******
That's what COPY can do.

One square formation has 3*3=9 people
***
***
***
Another square formation has 4*4=16 people
****
****
****
****
If you combine them, what do you get? The answer is 5*5=25 people
*****
*****
*****
*****
*****
Obviously, this is the result of recombining the two square formations, not of putting the second square next to the first.
That kind of thing is what COPY cannot do (even though 9+16=25)
Floor 7 Posted 2008-01-10 12:25 ·  中国 江西 南昌 电信
初级用户
Credits 48
Posts 22
Joined 2007-12-06 11:09
18-year member
UID 104819
Gender Male
Status Offline
Originally posted by bush at 2008-1-9 03:24 PM:

This question involves the issue of file header formats. Plain text of course doesn't have any special format. Other audio, video, graphics, images, and formatted documents (such as WORD) are all stored in specific data formats. ...

Thank you very much!!:P:P:P:P:P
Now I understand.
Floor 8 Posted 2008-01-10 14:42 ·  中国 内蒙古 巴彦淖尔 联通
新手上路
Credits 19
Posts 10
Joined 2007-11-03 12:14
18-year member
UID 101574
Gender Male
Status Offline
If mp3 files have the same bitrate, they can be combined, and you can listen to two songs continuously.
WMA files with the same encoding can also be combined, but you can only hear one song. For example,
copy /b 1.wma+2.wma 3.wma only lets you hear 2.wma.
Floor 9 Posted 2008-01-10 21:26 ·  中国 江西 南昌 电信
初级用户
Credits 48
Posts 22
Joined 2007-12-06 11:09
18-year member
UID 104819
Gender Male
Status Offline
Originally posted by 635635635 at 2008-1-10 02:42 PM:
If mp3 files have the same bitrate, they can be combined, and you can listen to two songs continuously.
WMA files with the same encoding can also be combined, but you can only hear one song. For example,
copy /b 1.wma+2.wma 3.wma only lets you hear 2.wma.

How come what I hear is 1.wma? Why? That's strange.

[ Last edited by raysea007 on 2008-1-10 at 10:04 PM ]
Floor 10 Posted 2008-01-11 20:11 ·  中国 湖南 长沙 电信
新手上路
Credits 13
Posts 7
Joined 2008-01-11 19:37
18-year member
UID 108334
Gender Male
Status Offline
Experts from all sides, I'm just a newbie. Lately I've become downright obsessed with DOS, and I've run into the same problem here too. I used copy/b 1.rmvb+2.rmvb 3.rmvb to combine two files, and I still couldn't open it. When I played it with Baofeng Media, the screen was completely black. Even after reading the explanations above from the big brothers, I still don't understand. So is there any way to successfully combine two or more video files with copy????
Floor 11 Posted 2008-01-12 13:02 ·  中国 江西 南昌 电信
初级用户
Credits 48
Posts 22
Joined 2007-12-06 11:09
18-year member
UID 104819
Gender Male
Status Offline
Originally posted by hong555hong at 2008-1-11 08:11 PM:
Experts from all sides, I'm just a newbie. Lately I've become downright obsessed with DOS, and I've run into the same problem here too. I used copy/b 1.rmvb+2.rmvb 3.rmvb to combine two files, and I still couldn' ...

Didn't post #5 and post #8 already say it? Files with the same bitrate can be combined, so the audio/video files we found must not have the same bitrate. I know the reason now, but I still haven't successfully combined them yet!:D:D:D:D:D
Floor 12 Posted 2008-01-13 12:12 ·  中国 上海 松江区 电信
初级用户
Credits 37
Posts 19
Joined 2008-01-11 23:38
18-year member
UID 108349
Gender Male
Status Offline
Originally posted by raysea007 at 2008-1-12 01:02 PM:

Didn't post #5 and post #8 already say it? Files with the same bitrate can be combined, so the audio/video files we found must not have the same bitrate. I know the reason now, but I still haven't successfully combined them yet!:D:D:D:D:D

A bump,
Floor 13 Posted 2008-01-13 18:35 ·  中国 山东 烟台 电信
中级用户
★★
Credits 257
Posts 123
Joined 2008-01-05 11:08
18-year member
UID 107722
Gender Male
From 烟台
Status Offline
Expert indeed
Big bump
路 是自己选的
学习 是为了具备解决问题的能力
Floor 14 Posted 2008-01-13 21:21 ·  中国 天津 电信
初级用户
Credits 22
Posts 10
Joined 2008-01-01 17:31
18-year member
UID 107408
Gender Male
Status Offline
Learning
Floor 15 Posted 2008-01-14 11:11 ·  中国 江西 南昌 电信
初级用户
Credits 48
Posts 22
Joined 2007-12-06 11:09
18-year member
UID 104819
Gender Male
Status Offline
We've only been focusing on the copy command. If there are only a few files, using the copy command is better. If there are many, then generally the xcopy command is used. But I thought of a question. Since audio/video files are relatively large, in theory it should be better to use the xcopy command when combining them, so I tried the xcopy command. But I found a problem, please advise!!!!!

C:\Documents and Settings\Administrator>xcopy 01.wma + 02.wma 03.wma
Invalid number of parameters

C:\Documents and Settings\Administrator>xcopy /b 01.wma + 02.wma 03.wma
Invalid number of parameters

I thought maybe it was because I was combining too few files, so I added a few more, but the result was still the same, C:\Documents and Settings\Administrator>xcopy/b 01.wma + 02.wma +

03.wma +04.wma
+05.wma 06.wma
Invalid number of parameters
Who can explain? Thank you!!!!!!!!!!!

[ Last edited by raysea007 on 2008-1-14 at 11:28 AM ]
Forum Jump: