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 16:01
中国DOS联盟论坛 » DOS批处理 & 脚本技术(批处理室) » Question about using the XCOPY command to copy a folder View 993 Replies 3
Original Poster Posted 2010-03-09 14:10 ·  中国 上海 广电网
新手上路
Credits 7
Posts 5
Joined 2008-01-14 10:02
18-year member
UID 108545
Gender Male
Status Offline
I want to make XCOPY not only copy the subdirectories under that directory and the files in those subdirectories, but also copy the folder itself. For example, the file structure is as follows:
D:\
----------A (folder)
------A1 (subfolder)
.....(files under the A1 folder)

E:\
I want to copy the entire A folder to E, so that the final folder structure is
E:\
----------A (folder)
------A1 (subfolder)
.....(files under the A1 folder)
Using the command XCOPY D:\A E:\ /e /s /d only gives the following result
E:\
------A1 (subfolder)
.....(files under the A1 folder)

How can I achieve the function described above?
Floor 2 Posted 2010-03-09 14:18 ·  中国 上海 联通
初级用户
Credits 33
Posts 32
Joined 2006-02-21 23:08
20-year member
UID 50740
Gender Male
Status Offline
Floor 3 Posted 2010-03-09 15:19 ·  中国 上海 广电网
新手上路
Credits 7
Posts 5
Joined 2008-01-14 10:02
18-year member
UID 108545
Gender Male
Status Offline
Many thanks to post #2
Floor 4 Posted 2010-03-09 15:25 ·  中国 上海 联通
初级用户
Credits 33
Posts 32
Joined 2006-02-21 23:08
20-year member
UID 50740
Gender Male
Status Offline
You're welcome.
Forum Jump: