Click here to Skip to main content
12,062,966 members (30,607 online)
Rate this:
 
Please Sign up or sign in to vote.
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
Jibesh17.1K
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

Rate this: bad
 
good
Please Sign up or sign in to vote.

Solution 1

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 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)

  Print Answers RSS
Top Experts
Last 24hrsThis month


Advertise | Privacy | Mobile
Web02 | 2.8.160204.4 | Last Updated 18 Feb 2013
Copyright © CodeProject, 1999-2016
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