| Re: xcopy command line for files and folders The date and time was Friday, June 12, 2009 10:57:07 AM, and on a whim,
Pegasus [MVP] pounded out on the keyboard:
> "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.
>
>
Thanks Pegasus, I'll give that a try. I had tried tape*.* with xcopy,
but not using FOR. It would copy what was in the root folder, but not
the folders and data themselves.
Terry R.
--
Anti-spam measures are included in my email address.
Delete NOSPAM from the email address after clicking Reply. |