Windows 7 Forums


Windows 7: How to copy folders using wildcards

27 Dec 2012   #1

windows 7 ultimate 64 bit
 
 
How to copy folders using wildcards

i need to copy folders from one network drive to another drive each night. The structure of the folders are


10a
10b
10c
11a
11b
11c
12a
12b
12c

i only want to copy the folders starting with 12, there will be a random amount of folders created starting with 12 by the end of the year it could be up to 20 folders all starting with 12, i need to use a wildcard so i don't miss any of them. i would like to put the correct process in a batch file if possible but if not i can run each night manually

i can't seem to get this to work with copy , xcopy or robocopy

copy p:\client\12*. z:\clientbak\12*. /s this is an example of what i would like to do with whatever

copy program and with the correct syntax the above doesn't work with xcopy , copy or robocopy

My System SpecsSystem Spec

27 Dec 2012   #2

Windows 7 Pro x64 SP1
Rockville, Maryland USA
 
 

Welcome Dsikirica to the windows 7 forum.
I suggest xcopy with the wildcard xcopy p:\client\12*.* z:\clientbak /s/i/m should copy the files you need
to the clientbak directory, creating the new directories if you wish.

Rich
My System SpecsSystem Spec
27 Dec 2012   #3

windows 7 ultimate 64 bit
 
 

thanks for replying: it said 0 files copied, it doesn't copy anything, i put a new file in one of the 12 folders to test it
My System SpecsSystem Spec
.


28 Dec 2012   #4

Windows 7 Pro x64 SP1
Rockville, Maryland USA
 
 

Dsikirica, you are running the command prompt with administrators privs aren't you?

Rich
My System SpecsSystem Spec
28 Dec 2012   #5

windows 7 ultimate 64 bit
 
 

I know i had tried that, but it didn't seem to make a difference, so i tried it again making sure i was running it as administrator, it didn't work but it said invalid drive specification this time before 0 files copied

if i use dir instead of xcopy on the source it shows the folders just fine
if i use dir on the destination directory it shows that just fine also

not sure if that is a good test or not, but i didn't get an invalid drive specification
My System SpecsSystem Spec
28 Dec 2012   #6

Windows 7 Pro x64 SP1
Rockville, Maryland USA
 
 

Dsikirica, copy and paste your exact batch command into a message, an invalid drive specification error might be because of misformed batch command.

Rich
My System SpecsSystem Spec
03 Jan 2013   #7

windows 7 ultimate 64 bit
 
 

xcopy p:\client\12*.* z:\clientbak\ /s /i /m
My System SpecsSystem Spec
03 Jan 2013   #8

Win7 Home Premium 64x
 
 

It might be because you are using a mapped drive. I would suggest trying on your c: drive to make sure the syntax works ok. copy from one location on C to another location on C, then try from P: to C: and then C: to Z:

You might see where the issue is occuring.
My System SpecsSystem Spec
04 Jan 2013   #9

windows 7 ultimate 64 bit
 
 

this is so frustrating, thanks for your help so far i really appreciate it

i copied the whole structure down to my c drive and tried to xcopy it to another local drvie G:

0 files copied

dir works with both ends of the xcopy command

maybe it's a windows 7 problem, i will try on an xp machine and let you know how that works, not sure that matters but worth a try
My System SpecsSystem Spec
Reply

 How to copy folders using wildcards problems?



Thread Tools



Similar help and support threads for: How to copy folders using wildcards
Thread Forum
Using notepad to search wildcards General Discussion
Windows Search hate club... why no wildcards?? General Discussion
Copy Emails from Imported Folders Browsers & Mail
Copy folders including timestamp General Discussion
Copy from DVD-R is slow with multiple folders? General Discussion


All times are GMT -5. The time now is 04:55 PM.


Seven Forums Android App Seven Forums IOS App Follow us on Facebook

Windows 7 Forums is an independent web site and has not been authorized,
sponsored, or otherwise approved by Microsoft Corporation.
"Windows 7" and related materials are trademarks of Microsoft Corp.
© Designer Media Ltd
  

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32