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-15 13:36
中国DOS联盟论坛 » DOS疑难解答 & 问题讨论 (解答室) » [Help] Why can't I copy directories together when using XCOPY? View 4,267 Replies 27
Original Poster Posted 2007-03-27 10:39 ·  中国 安徽 合肥 电信
中级用户
★★
Credits 334
Posts 154
Joined 2007-03-24 02:14
19-year member
UID 82713
Gender Male
Status Offline
Why can't XCOPY copy directories together?
Floor 2 Posted 2007-03-27 10:51 ·  中国 山西 晋城 联通
初级用户
★★
Credits 155
Posts 68
Joined 2007-02-02 23:29
19-year member
UID 78450
Gender Male
Status Offline
Adding the /s parameter allows copying subdirectories together
Floor 3 Posted 2007-03-27 17:54 ·  中国 江苏 苏州 电信
中级用户
★★
我是DOS学者
Credits 367
Posts 180
Joined 2006-05-14 10:53
20-year member
UID 55507
Gender Male
From 重庆
Status Offline
But the root directory is still not okay. Every time I copy, I first create a directory on another disk and then copy, only then can it work! I don't know if I didn't read the parameters clearly!
Floor 4 Posted 2007-03-28 01:36 ·  中国 安徽 合肥 电信
中级用户
★★
Credits 334
Posts 154
Joined 2007-03-24 02:14
19-year member
UID 82713
Gender Male
Status Offline
Adding parameters still doesn't work.
Floor 5 Posted 2007-03-28 01:51 ·  中国 山东 济南 移动
钻石会员
★★★★★
Credits 10,056
Posts 3,041
Joined 2002-11-11 00:00
23-year member
UID 223
Gender Male
Status Offline
There is no situation that I haven't seen, and I really want to experience it.
简单就是美
Floor 6 Posted 2007-03-28 02:40 ·  中国 江苏 常州 溧阳市 电信
银牌会员
★★★
Credits 2,404
Posts 946
Joined 2005-09-08 13:44
20-year member
UID 42345
Status Offline
xcopy /e /q /i /h /r /y c:\source folder d:\target folder
It works on my machine, XP2
Floor 7 Posted 2007-03-28 03:05 ·  中国 江苏 连云港 电信
高级用户
★★★
前进者
Credits 641
Posts 303
Joined 2007-01-10 02:57
19-year member
UID 76009
Gender Male
Status Offline
The target doesn't need to exist in advance, relying on the /i parameter.
我相信总有一天,总会遇到一个人可以相濡以沫、相吻以湿!
Floor 8 Posted 2007-03-28 07:18 ·  中国 安徽 合肥 电信
中级用户
★★
Credits 334
Posts 154
Joined 2007-03-24 02:14
19-year member
UID 82713
Gender Male
Status Offline
I tried it, but it still doesn't work.郁闷. . . . .
Floor 9 Posted 2007-03-28 11:16 ·  中国 山西 晋城 联通
初级用户
★★
Credits 155
Posts 68
Joined 2007-02-02 23:29
19-year member
UID 78450
Gender Male
Status Offline
Can't be? /i Should be no problem ah

xcopy "source directory name" "destination directory name" /i
If you want to copy subdirectories together, add /s at the end
Floor 10 Posted 2007-03-28 11:40 ·  中国 江苏 苏州 电信
中级用户
★★
我是DOS学者
Credits 367
Posts 180
Joined 2006-05-14 10:53
20-year member
UID 55507
Gender Male
From 重庆
Status Offline
/I If the target does not exist and more than one file is being copied,
then it is assumed that the target must be a directory.

This system explains it like this: xcopy "source directory name" "destination directory name" /i

So, is the destination directory name created by oneself or the same as when I copy? What if it doesn't exist?
Floor 11 Posted 2007-03-28 12:48 ·  中国 江苏 常州 溧阳市 电信
银牌会员
★★★
Credits 2,404
Posts 946
Joined 2005-09-08 13:44
20-year member
UID 42345
Status Offline
The goal can be the same as copy even if it doesn't exist in advance
Floor 12 Posted 2007-03-28 17:59 ·  中国 广东 广州 番禺区 电信
初级用户
★★
Credits 107
Posts 52
Joined 2007-03-10 04:55
19-year member
UID 81272
Gender Male
Status Offline
Originally posted by terse at 2007-3-27 01:40 PM:
xcopy /e /q /i /h /r /y c:\source folder d:\target folder
It works on my machine, XP2

Agree
Floor 13 Posted 2007-03-29 03:44 ·  中国 山西 晋城 电信
初级用户
★★
Credits 155
Posts 68
Joined 2007-02-02 23:29
19-year member
UID 78450
Gender Male
Status Offline
Originally posted by BWSkyer at 2007-3-27 10:40 PM:
/I If the target does not exist and more than one file is being copied,
it is assumed that the target must be a directory.

This system explains it like this: xcopy "source directory name" & ...


No need to create it in advance, this command will create it automatically
Floor 14 Posted 2007-03-29 04:56 ·  中国 安徽 合肥 电信
中级用户
★★
Credits 334
Posts 154
Joined 2007-03-24 02:14
19-year member
UID 82713
Gender Male
Status Offline
I made this under the command line of XP. xcopy d:\th e:\ /s and press Enter. Copy the th folder and its files on drive D to drive E. Only files are copied but folders are not.
Floor 15 Posted 2007-03-29 05:44 ·  中国 河北 保定 联通
铂金会员
★★★★
网络独行侠
Credits 6,962
Posts 2,753
Joined 2003-04-16 00:00
23-year member
UID 1565
Gender Male
From 河北保定
Status Offline
xcopy d:\th e:\th /s /i
偶只喜欢回答那些标题和描述都很清晰的帖子!
如想解决问题,请认真学习“这个帖子”和“这个帖子”并努力遵守,如果可能,请告诉更多的人!
Forum Jump: