XCopy Problem

S

Shaun

Hi,

I am trying to copy all folders, subfolders and files with folder names that
curly braces at the start and end of the folder name from C:\Home\a\b\ab\ to
C:\Home\a\b\ab\www\images

To get around the cyclic copy problem I am trying to copy the folders to a
temporary location then back to the intended destination. Here is what i
have done so far:

xcopy C:\Home\a\b\ab\{*} C:\Home\a\b\tmp\ /E
xcopy C:\Home\a\b\tmp\{*} C:\Home\a\b\ab\www\images\ /E /Y

The 2 problems I have do far is that the 1st statement copies every folder
not just folders with curly braces at the start and end of the folder name.
The 2nd problem is that it only copies the directories not the files.

Any help would be greatly appreciated.
 
J

Jerry

Open a DOS box and type XCOPY /? for a list of all the switches that can be
used. My guess is you're not using the ones that allow for the copying of
subfolders and hidden files/folders.
 
H

Haggis

Shaun said:
Hi,

I am trying to copy all folders, subfolders and files with folder names that
curly braces at the start and end of the folder name from C:\Home\a\b\ab\ to
C:\Home\a\b\ab\www\images

To get around the cyclic copy problem I am trying to copy the folders to a
temporary location then back to the intended destination. Here is what i
have done so far:

xcopy C:\Home\a\b\ab\{*} C:\Home\a\b\tmp\ /E
xcopy C:\Home\a\b\tmp\{*} C:\Home\a\b\ab\www\images\ /E /Y

The 2 problems I have do far is that the 1st statement copies every folder
not just folders with curly braces at the start and end of the folder name.
The 2nd problem is that it only copies the directories not the files.

Any help would be greatly appreciated.

try this just to make sure each line is working...remove the "pause" when
satisfied :>

also see xcopy /? at the prompt for more options

xcopy C:\Home\a\b\ab\*.* C:\Home\a\b\tmp\ /E
pause
xcopy C:\Home\a\b\tmp\*.* C:\Home\a\b\ab\www\images\ /E /Y
 
S

Shaun

Thank you for your replies, I had investigated this and according to the
help files /E does the following:

/E Copies directories and subdirectories, including empty ones.
Same as /S /E. May be used to modify /T.

If I'm not mistaken this is what I am trying to achieve...
 
S

Steve Shattuck

I am trying to copy all folders, subfolders and files with folder names
that curly braces at the start and end of the folder name from
C:\Home\a\b\ab\ to C:\Home\a\b\ab\www\images
To get around the cyclic copy problem I am trying to copy the folders to a
temporary location then back to the intended destination. Here is what i
have done so far:
xcopy C:\Home\a\b\ab\{*} C:\Home\a\b\tmp\ /E
xcopy C:\Home\a\b\tmp\{*} C:\Home\a\b\ab\www\images\ /E /Y

This is almost impossible to accomplish. The reason is that the syntax of
the "*" wildcard is to ignore ANYTHING that comes after the previous
character to the period. In other words it has ignored the ending "}" and
thus will never find the files. There is only one situation where you can
do what you want and that is where the length of all files are the same
length as would be the case with files containing a CLSID which are always
36 digits long where you could use the following:

xcopy C:\Home\a\b\ab\{????????????????????????????????????}
..__
(__
__ )teve www.steve.shattuck.net (e-mail address removed)
 
S

Shaun

Steve Shattuck said:
This is almost impossible to accomplish. The reason is that the syntax of
the "*" wildcard is to ignore ANYTHING that comes after the previous
character to the period. In other words it has ignored the ending "}" and
thus will never find the files. There is only one situation where you can
do what you want and that is where the length of all files are the same
length as would be the case with files containing a CLSID which are always
36 digits long where you could use the following:

xcopy C:\Home\a\b\ab\{????????????????????????????????????}
.__
(__
__ )teve www.steve.shattuck.net (e-mail address removed)

Thanks for your help Steve,

The confusing thing is that either of the following statements copies other
folders i.e. www

xcopy C:\Home\a\b\ab\{????????????????????????????????????} C:\Home\a\b\tmp
/E
xcopy C:\Home\a\b\ab\{* C:\Home\a\b\tmp /E

surely folder www shouldnt be included!
 
P

PopS

XXCopy.exe will do exactly what you want, even using the same
exact syntax, except it "knows" how to prevent Cyclic Redundancy
problems. And it's free. www.xxcopy.com.
Try it, you'll like it. Available there or from thousands of
mirrors; about everyone carries it. Oh, no ads, adware, etc,
come with it; just the program.

HTH,
Pop
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Similar Threads

xcopy using batch file 4
Folder changes to hidden during backup 5
xcopy 10
Problems with date checking on xcopy 1
Windows XP Offline File Restore Nightmare 1
XCopy Exclude Function NOT Working 2
xcopy 9
xcopy 4

Top