Click here to Skip to main content
11,496,146 members (366 online)
The site is currently in read-only mode for maintenance. Posting of new items will be available again shortly.
See more: batch
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 18-Feb-13 12:50pm
Edited 18-Feb-13 12:59pm
Jibesh16.8K
v2
Comments
Sergey Alexandrovich Kryukov at 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
  Permalink  
Comments
Member 9845166 at 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 at 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)

  Print Answers RSS
0 Sergey Alexandrovich Kryukov 10,401
1 OriginalGriff 8,910
2 Sascha Lefèvre 3,899
3 Maciej Los 3,422
4 Richard Deeming 2,600


Advertise | Privacy | Mobile
Web04 | 2.8.150520.1 | Last Updated 18 Feb 2013
Copyright © CodeProject, 1999-2015
All Rights Reserved. Terms of Service
Layout: fixed | fluid

CodeProject, 503-250 Ferrand Drive Toronto Ontario, M3C 3G8 Canada +1 416-849-8900 x 100