Page 1 of 1
Copy sub folders with them files from folder a to folder b
Posted: 10 Sep 2012 03:08
by moh_salah8
Hello all,
the problem
If i've one folder (a) contains many sub folders, these sub folders contain files with the same them folder name and another folder(b) contains 4 or 5 sub folders from folder (a)
I need your help to copy sub folders and them files from folder (a) to folder (b)
i hope to find your reply soon.
Thanks.
Re: Copy sub folders with them files from folder a to folder
Posted: 10 Sep 2012 04:49
by foxidrive
with the same them folder name
Try writing that again, and use some punctuation.
I, for one, don't quite understand what you want to do.
Re: Copy sub folders with them files from folder a to folder
Posted: 10 Sep 2012 04:59
by moh_salah8
i mean if the folder name is "a", the file name in this folder is "a" .
Thanks for ur reply.
Re: Copy sub folders with them files from folder a to folder
Posted: 10 Sep 2012 05:12
by foxidrive
So you have
c:\a\one\one.txt
c:\a\two\two.txt
c:\a\three\three.txt
What do you want to do with them?
Re: Copy sub folders with them files from folder a to folder
Posted: 10 Sep 2012 06:00
by moh_salah8
Sorry for late.
There is amendment to make the issue more clarification
We can change the batch idea to copy and replace some folders with sub folders and files to many paths.
c:\a\one\one.txt
c:\a\two\two.txt
c:\a\three\three.txt
---
c:\b\one\one.txt
c:\b\two\two.txt
c:\b\three\three.txt
I need to copy and replace them to
d:\a\one\one.txt
d:\a\two\two.txt
d:\a\three\three.txt
---------
d:\b\one\one.txt
d:\b\two\two.txt
d:\b\three\three.txt
- I need to copy sub folders with files to many paths by only one step to save a time.
sorry because i can't explain the issue as well and thanks for your patience
Thanks.
Re: Copy sub folders with them files from folder a to folder
Posted: 10 Sep 2012 06:06
by foxidrive
Maybe this will do what you want.
Code: Select all
@echo off
xcopy "c:\a\*.*" "d:\a\" /s
xcopy "c:\b\*.*" "d:\b\" /s
Re: Copy sub folders with them files from folder a to folder
Posted: 10 Sep 2012 06:25
by moh_salah8
Not exactly,
I've this command to copy files but the folders should be .Zip
FOR /F %%G IN ('dir /b %1') DO ROBOCOPY %1\%%G\ *.* %2\%%G /z
I need it to copy folders and files without compressing them.
Re: Copy sub folders with them files from folder a to folder
Posted: 10 Sep 2012 07:29
by foxidrive
What's wrong with the commands I gave?
Re: Copy sub folders with them files from folder a to folder
Posted: 10 Sep 2012 08:10
by moh_salah8
Your command line is fine but it works on one case.
I need command line work generally by giving it the original and the another path.
Re: Copy sub folders with them files from folder a to folder
Posted: 10 Sep 2012 08:14
by foxidrive
Then add parameters to the commands.
Next time you ask for help, please describe exactly what you want.
If you want to specify paths on the command line, then say so. Give examples.