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-07-14 23:27
中国DOS联盟论坛 » DOS批处理 & 脚本技术(批处理室) » Help: Copy files or folders under indefinite subdirectories View 1,651 Replies 4
Original Poster Posted 2007-03-10 22:33 ·  中国 河北 张家口 联通
初级用户
Credits 20
Posts 8
Joined 2007-03-10 22:03
19-year member
UID 81332
Gender Male
Status Offline
I want to understand how to copy specific files or folders in subdirectories. For example: There is a file named abc.txt in the C: subdirectory (the path is not clear), and I want to find it and copy it to another place. I'm a beginner, and I hope to be explained in detail.
Floor 2 Posted 2007-03-10 23:13 ·  中国 陕西 西安 电信
铂金会员
★★★★
Credits 5,212
Posts 2,478
Joined 2007-02-08 23:39
19-year member
UID 79003
Gender Male
Status Offline
dir /s /b c:\abc.txt
Floor 3 Posted 2007-03-11 01:34 ·  中国 河北 张家口 联通
初级用户
Credits 20
Posts 8
Joined 2007-03-10 22:03
19-year member
UID 81332
Gender Male
Status Offline
Then I want to use copy to copy this file to another disk. How to call this path?
Floor 4 Posted 2007-03-11 01:37 ·  中国 浙江 绍兴 诸暨市 电信
高级用户
★★★
Autowalk
Credits 845
Posts 375
Joined 2007-03-03 01:58
19-year member
UID 80606
Gender Male
Status Offline
echo
for /f %%i in ('dir /s /b c:\abc.txt') do copy %%i d:\
Recent Ratings for This Post ( 1 in total) Click for details
RaterScoreTime
veryrabbit +1 2007-03-11 02:00
Floor 5 Posted 2007-03-11 02:00 ·  中国 河北 张家口 联通
初级用户
Credits 20
Posts 8
Joined 2007-03-10 22:03
19-year member
UID 81332
Gender Male
Status Offline
Thanks
Forum Jump: