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-11 00:53
中国DOS联盟论坛 » DOS批处理 & 脚本技术(批处理室) » How to move a folder with batch processing? View 1,466 Replies 3
Original Poster Posted 2007-11-13 23:21 ·  中国 福建 福州 电信
新手上路
Credits 4
Posts 1
Joined 2007-11-09 15:24
18-year member
UID 102156
Gender Male
Status Offline
I am using the XP system.
Need to move a folder. There are subfolders and files under the folder.
For example, there is a folder A under the C drive. There are folders 1, 2, 3, 4.... inside it, all with files. There are also files in the root directory of folder A. Need to move all the contents inside folder A to directory B on the D drive (it's the files and folders under A, not the entire folder A).

The move command cannot be used to move folders.
I thought about using xcopy and then deleting the directory, but encountered another problem.
del can only delete files.
rd can delete folders, but it also deletes folder A together (I need to keep folder A, but not the files and folders inside it).

Do I make myself clear? Can anyone help?

[ Last edited by icekirin on 2007-11-13 at 11:24 PM ]
Floor 2 Posted 2007-11-14 08:52 ·  中国 重庆 江北区 电信
初级用户
★★
Credits 92
Posts 82
Joined 2007-11-13 23:35
18-year member
UID 102602
Gender Male
Status Offline
Floor 3 Posted 2007-11-14 14:15 ·  中国 湖北 武汉 电信
版主
★★★★★
Credits 11,386
Posts 4,938
Joined 2006-07-23 17:10
20-year member
UID 59080
Status Offline
After entering folder A, execute "rd /s/q .\".
Floor 4 Posted 2008-12-12 22:24 ·  中国 福建 泉州 电信
初级用户
★★
Credits 112
Posts 81
Joined 2008-04-11 23:47
18-year member
UID 115654
Gender Male
Status Offline
Really want to know. Batch processing seems there is no way to achieve. Best can directly cut (move) past. Don't use copy past. Then delete the original folder..

Difficult ah....

[ Last edited by ktv98 on 2008-12-12 at 22:27 ]
CN-DOS批处理室非官方QQ群①:61377162 ②:70174619 ③:75070617
请勿尝试同时加多个群
Forum Jump: