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-10-24 18:52
中国DOS联盟论坛 » DOS疑难解答 & 问题讨论 (解答室) » [Help] Why can't I copy directories together when using XCOPY? View 4,738 Replies 27
Floor 16 Posted 2007-03-29 05:44 ·  中国 江苏 常州 武进区 电信
银牌会员
★★★
Credits 2,404
Posts 946
Joined 2005-09-08 13:44
21-year member
UID 42345
Status Offline
xcopy d:\th e:\th /s /i
Floor 17 Posted 2007-03-29 05:45 ·  中国 安徽 合肥 电信
中级用户
★★
Credits 334
Posts 154
Joined 2007-03-24 02:14
19-year member
UID 82713
Gender Male
Status Offline
The correct answer is: xcopy d:\th e:\th /s/e and then press Enter
Floor 18 Posted 2007-03-29 05:48 ·  中国 安徽 合肥 电信
中级用户
★★
Credits 334
Posts 154
Joined 2007-03-24 02:14
19-year member
UID 82713
Gender Male
Status Offline
Thanks to the brothers on floors 15 and 16. What's the difference between adding "i" and adding "e"?

[ Last edited by wangmeng052 on 2007-3-28 at 04:49 PM ]
Floor 19 Posted 2007-03-29 05:53 ·  中国 江苏 常州 武进区 电信
银牌会员
★★★
Credits 2,404
Posts 946
Joined 2005-09-08 13:44
21-year member
UID 42345
Status Offline
Not adding "i" is to prompt for confirmation whether E:\TH is a directory or a file
Floor 20 Posted 2007-03-29 07:02 ·  中国 安徽 合肥 电信
中级用户
★★
Credits 334
Posts 154
Joined 2007-03-24 02:14
19-year member
UID 82713
Gender Male
Status Offline
Thank you very much. One more question, does the xcopy command exist in DOS entered from a 98 boot disk?
Floor 21 Posted 2007-05-17 23:11 ·  中国 浙江 杭州 电信
初级用户
★
Credits 83
Posts 34
Joined 2007-04-22 23:47
19-year member
UID 86116
Gender Male
Status Offline
Originally posted by terse at 2007-3-28 02:40 AM:
xcopy /e /q /i /h /r /y c:\source folder d:\target folder
It works on my machine. XP2


What is the difference between adding Y and not adding Y? Thanks
快乐崇拜
Floor 22 Posted 2007-05-18 03:35 ·  中国 河北 邢台 电信
中级用户
★★
Credits 242
Posts 134
Joined 2006-12-11 15:14
19-year member
UID 73203
Gender Male
Status Offline
Originally posted by terse at 2007-3-29 05:53 AM:
Not adding "i" is to prompt for confirmation whether E:\TH is a directory or a file


There is this command, but it does not support long file names, and many parameters that are valid under XP are invalid here.
Floor 23 Posted 2007-06-02 00:20 ·  中国 河南 濮阳 联通
初级用户
★
Credits 64
Posts 27
Joined 2007-05-31 20:42
19-year member
UID 89903
Gender Male
Status Offline
None
Floor 24 Posted 2009-02-18 23:49 ·  中国 广东 深圳 罗湖区 电信
新手上路
★
Credits 12
Posts 6
Joined 2007-09-07 21:09
19-year member
UID 96818
Gender Male
Status Offline
The path must be complete. If it's incomplete, the copied and arranged ones will be chaotic.
Floor 25 Posted 2009-04-19 07:12 ·  中国 江苏 无锡 电信
高级用户
★★
Credits 616
Posts 187
Joined 2003-04-18 00:00
23-year member
UID 1598
Gender Male
Status Offline
xcopy /e /q /i /h /r /y c:\Source Folder d:\Target Folder
It can also work on my machine
Floor 26 Posted 2009-04-20 02:07 ·  中国 浙江 宁波 电信
初级用户
★
Credits 34
Posts 12
Joined 2007-01-16 08:07
19-year member
UID 76667
Gender Male
Status Offline
The correct answer is: xcopy d:\th\*.* e:\th /s/e and then press Enter. If it still doesn't work, you can add a wildcard, which should work.
Floor 27 Posted 2009-08-05 05:43 ·  中国 四川 德阳 绵竹市 电信
中级用户
★★
Credits 274
Posts 192
Joined 2009-01-07 21:09
17-year member
UID 136069
Gender Male
Status Offline
Floor 28 Posted 2009-11-09 19:32 ·  中国 上海 虹口区 电信
中级用户
★★
Credits 248
Posts 126
Joined 2008-05-30 17:18
18-year member
UID 120118
Gender Male
Status Offline
Copy files and directory trees.

XCOPY source ] ]


...]

source Specifies the file(s) to copy.
destination Specifies the location and/or name of new files.
/A Copies only files with the archive attribute set,
but doesn't change the attribute.
/M Copies only files with the archive attribute set,
and clears the archive attribute.
/D:m-d-y Copies files changed on or after the specified date.
If no date is given, copies only those files whose source
time is newer than the destination time.
/EXCLUDE:file1...
Specifies a list of files containing strings. Each string
must be in a separate line in the file. If any string matches the
absolute path of the file to be copied, that file will not be copied.
For example, specifying a string like \obj\ or .obj will exclude
all files under directory obj or files with the .obj extension.
/P Prompts before creating each destination file.
/S Copies directories and subdirectories, excluding empty ones.
/E Copies directories and subdirectories, including empty ones.
Same as /S /E. Can be used to modify /T.
/V Verifies each new file.
/W Prompts you to press a key before copying.
/C Continues copying even if errors occur.
/I If destination doesn't exist and copying more than one file,
assumes destination is a directory.
/Q Does not display file names while copying.
/F Displays full source and destination file names while copying.
/L Displays files to be copied.
/G Allows copying unencrypted files to destinations that do not support encryption.
/H Also copies hidden and system files.
/R Overwrites read-only files.
/T Creates directory structure but does not copy files.
Does not include empty directories or subdirectories. /T /E includes
empty directories and subdirectories.
/U Copies only files that already exist in destination.
/K Copies attributes. Normal Xcopy resets read-only attributes.
/N Copies using generated short names.
/O Copies file ownership and ACL information.
/X Copies file auditing settings (implies /O).
/Y Copies file auditing settings (implies /O).
Existing destination files.
/-Y Causes prompting to confirm overwriting an
existing destination file.
/Z Copies network files in restartable mode.

The command-line switch /Y may be preset in the COPYCMD environment variable.
This may be overridden with /-Y on the command line.

This is the XCOPY parameter under CMD. Some parameters like /I are not available in pure DOS, but /E is definitely there. The owner can refer to it and play around...
Forum Jump: