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-12 14:50
中国DOS联盟论坛 » DOS学习入门 & 精彩文章 (教学室) » Question about XCOPY!? View 728 Replies 5
Original Poster Posted 2003-06-28 00:00 ·  中国 重庆 电信
银牌会员
★★★
Credits 2,202
Posts 499
Joined 2003-06-12 00:00
23-year member
UID 4876
Gender Male
Status Offline
I want to copy folder 1 on drive C, including everything in it, to drive D. But when I use xcopy, it copies all the files under 1 straight onto D in a complete mess, scattered all over the place. Is this command wrong?:
xcopy c:\1 d:
一年四季,枫叶红了又红;人生四季,失去的,还能再来吗?—— !
Floor 2 Posted 2003-06-28 00:00 ·  中国 安徽 滁州 天长市 电信
银牌会员
★★★
Credits 1,835
Posts 648
Joined 2002-11-08 00:00
23-year member
UID 197
Gender Male
Status Offline
XCOPY copies the contents under a folder to another directory. For example, if you use xcopy c:\1 d:, it actually copies the files under the c:\1 folder to d:, and does not include the 1 directory level itself. Also, if you want to copy everything under c:\1 (including subdirectories and empty directories), then you need to add the /s and /e parameters.
Floor 3 Posted 2003-06-28 00:00 ·  中国 江西 吉安 电信
版主
★★★★
Credits 7,296
Posts 1,628
Joined 2002-10-16 12:00
23-year member
UID 10
Gender Male
Status Offline
xcopy c:\1 d:\1 /s/e
It will ask whether you are copying to a file or a directory. Choose “directory” (just press the D key).
That way it won’t end up scattered all over the place!
Parameter S means include subdirectories, and parameter E means include empty subdirectories.
ko20010214
=================================
大功告成,打个Kiss!
ko20010214@MSN.com
神州优雅Q300C
Intel CeleronM 370处理器 | 256MbDDR内存
40G硬盘 | USB2.0 | IEEE 1394
13.3 ' WXGA 宽屏(16:10) | COMBO光驱
10/100M网卡 | 四合一读卡器
Floor 4 Posted 2003-06-28 00:00 ·  中国 安徽 滁州 天长市 电信
银牌会员
★★★
Credits 1,835
Posts 648
Joined 2002-11-08 00:00
23-year member
UID 197
Gender Male
Status Offline
Which XCOPY is KO using?
Why doesn’t my XCOPY ask me whether I’m copying to a file or a directory?
Floor 5 Posted 2003-06-28 00:00 ·  中国 重庆 电信
银牌会员
★★★
Credits 2,202
Posts 499
Joined 2003-06-12 00:00
23-year member
UID 4876
Gender Male
Status Offline
Ah, thanks! Thanks! That clears it up! . Many thanks to the brothers in the posts above!
一年四季,枫叶红了又红;人生四季,失去的,还能再来吗?—— !
Floor 6 Posted 2003-06-28 00:00 ·  中国 江西 吉安 电信
版主
★★★★
Credits 7,296
Posts 1,628
Joined 2002-10-16 12:00
23-year member
UID 10
Gender Male
Status Offline
The following is quoted from LanE at 2003-6-28 17:50:58:
Which XCOPY is KO using?
Why doesn’t my XCOPY ask me whether I’m copying to a file or a directory?

Man, I’m using the same xcopy as you.
When you copy a directory to a directory on another drive, if the target directory you specify does not exist on the other drive, it will ask whether you are copying to a file or a directory. If the answer is directory (press the D key), then it will create that target directory on the other drive first. Then it will proceed with the copy.
ko20010214
=================================
大功告成,打个Kiss!
ko20010214@MSN.com
神州优雅Q300C
Intel CeleronM 370处理器 | 256MbDDR内存
40G硬盘 | USB2.0 | IEEE 1394
13.3 ' WXGA 宽屏(16:10) | COMBO光驱
10/100M网卡 | 四合一读卡器
Forum Jump: