![]() |
China DOS Union-- Unite DOS · Advance DOS · Grow DOS --Union site: www.cn-dos.net Forum site: www.cn-dos.net/forum |
| Guest | Log in | Register | Members | Search | China DOS Union |
|
中国DOS联盟论坛 The time now is 2026-08-12 16:02 |
47,811 topics / 349,897 posts / today 0 new / 48,256 members |
| DOS学习入门 & 精彩文章 (教学室) » How to copy all files in directory A to all first-level subdirectories of directory B? |
| Printable Version 1,289 / 4 |
| Floor1 tangzhuokai | Posted 2009-08-12 03:05 |
| 新手上路 Posts 5 Credits 11 | |
|
How to copy all files in directory A
to all first-level subdirectories of directory B? |
|
| Floor2 mxzenf | Posted 2009-09-07 03:17 |
| 新手上路 Posts 9 Credits 15 | |
|
I'm a newbie too, haha... if I said something wrong, please don't mind. This is a question raised a long time ago, hehe, just giving the OP a bump:
for /l %i in ('dir/w/b B') do (copy %i a) |
|
| Floor3 wayaoqiang | Posted 2009-09-07 04:30 |
| 新手上路 Posts 7 Credits 8 | |
|
This is one approach; you'll need to change the specific paths for folders a and b yourself
@echo off for /f "delims=" %%a in ('dir /ad /b b') do ( for /f "delims=" %%i in ('dir /a-d /b a') do ( copy "a\%%i" "b\%%a" ) ) pause |
|
| Floor4 ruguokeyi110 | Posted 2009-09-14 14:03 |
| 初级用户 Posts 15 Credits 27 | |
|
To all first-level subdirectories of directory B? Did I get that wrong or what?
|
|
| Floor5 renxiaow | Posted 2010-01-07 10:08 |
| 新手上路 Posts 3 Credits 6 | |
|
Use xcopy
|
|
|
[ Contact the Union admin team -
中国DOS联盟 -
Standard version ] Sponsored by ifanr Inc | © 2001–2023 |