View Single Post
  #9 (permalink)  
Old 06-12-2009, 11:00 AM
Pegasus [MVP]
Newsgroup Contributor
 
Posts: n/a
Re: xcopy command line for files and folders


"Terry R." <F1Com@NOSPAMpobox.com> wrote in message
news:e0WzeEy6JHA.1424@TK2MSFTNGP02.phx.gbl...
>I have a partition that stores video. I store folders with names like:
> Tape 10
> Tape 10 DL
> Tape 11
> Tape 11 DL
>
> There are also files in the root with various extensions starting with:
> tape 10.avi
> tape 10.avi.index
> tape 10.scn
>
> What is the simplest xcopy command that will copy all the files in the
> root and also copy all the folders to another drive? I would like to be
> able to use wildcards for the tape numbers (1?) if possible.
>
> Thanks,
>
> Terry R.
> --
> Anti-spam measures are included in my email address.
> Delete NOSPAM from the email address after clicking Reply.


Maybe I'm missing something important, in particular since you're an
experienced batch file programmer, but I would have thought that this
two-liner would do the trick:
Line1=@echo off
Line2=for /d %%a in (U:\tape*.*) do echo xcopy /s /c /d /y "%%a\*.*"
"\\RemoteServer\SomeShare\SomeFolder%%~pa%%~na \"
Line3=echo xcopy /s /c /d /y U:\tape*.*
"\\RemoteServer\SomeShare\SomeFolder\"

Remove the word "echo" in lines 2 and 3 to activate the batch file.


Reply With Quote

 
Old 06-12-2009, 11:00 AM