Click here to Skip to main content
13,150,471 members (32,822 online)
Rate this:
Please Sign up or sign in to 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:

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

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 11:50am
Updated 18-Feb-13 11:59am
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.

1 solution

Rate this: bad
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.

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.

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 |
Web03 | 2.8.170924.2 | Last Updated 18 Feb 2013
Copyright © CodeProject, 1999-2017
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