Click here to Skip to main content
15,886,060 members
Please Sign up or sign in to vote.
1.00/5 (1 vote)
See more:
Hello, i have one problem in one bat file to copy the directories, files and subfiles but directoris must start for letter a i try something like this:

@ECHO OFF
CD ...
for /d %%X in (a*) do robocopy %%X "C:\Users\1"
PAUSE

This bat file copy sub directories and files but doesn't copy the first folder. Can you help me?

The best regards:
Joao Marques

[Edit] Removed shouting - by Jibesh[/edit]
Posted
Updated 18-Feb-13 11:59am
v2
Comments
Sergey Alexandrovich Kryukov 18-Feb-13 17:55pm    
What's the purpose of this copy? If you want to do it all using batch loops, you don't need robocopy. If you want to use robocopy, you don't need a loop.
—SA

1 solution

Please see my comment to the question. Are you merging all directories into one? Then you can have problems: some sub-directories/files in different merging branches can have identical names; another possible problem is permission. You need to check it up.

—SA
 
Share this answer
 
Comments
Member 9845166 18-Feb-13 18:11pm    
have one directory with files and other directories and i want copy the all directories that strats for letter "a".
Sergey Alexandrovich Kryukov 18-Feb-13 18:22pm    
You are merging them in one, right? Then I described the problems you might have. Please check up.
—SA

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900