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 09:48
中国DOS联盟论坛 » DOS疑难解答 & 问题讨论 (解答室) » Problems with xcopy copying the main directory View 1,700 Replies 2
Original Poster Posted 2010-06-08 21:33 ·  中国 山东 济南 联通
新手上路
Credits 15
Posts 10
Joined 2010-05-27 22:13
16-year member
UID 167756
Gender Male
Status Offline
For example, I have an a01 folder under drive D:, with 01.txt and a 02 subfolder. I want to copy it to the temp directory under drive D: so that it results in d:\temp\a01 along with the subfolders and files inside.

I used the commands xcopy d:\a01 d:\temp /e and xcopy d:\a01 d:\temp /s, but only 01.txt and the 02 folder are copied, and the main folder a01 isn't copied.

Please ask how to copy along with the a01 folder?
Floor 2 Posted 2010-06-08 21:56 ·  中国 山东 济南 联通
新手上路
Credits 15
Posts 10
Joined 2010-05-27 22:13
16-year member
UID 167756
Gender Male
Status Offline
By the way, I entered cmd by clicking [Start][Run] under the XP system. Is xcopy only usable in pure DOS?
Floor 3 Posted 2010-06-08 23:49 ·  中国 山东 济南 联通
新手上路
Credits 15
Posts 10
Joined 2010-05-27 22:13
16-year member
UID 167756
Gender Male
Status Offline
There is someone who answered online, and the answer is as follows:

xcopy cannot directly achieve the function you want because it only recognizes the things under the specified directory and does not recognize the folder itself:
It must be like this, adding the name of the target folder.
xcopy d:\a01 d:\temp\a01 /e /s /i
Forum Jump: