Re: Sophisticated(!) copying in DOS



I added
PATH \\SOURCEDRIVE\SHAREDDOCS

And now get
'xcopy' is not recognized as an internal or external command,
operable program or batch file

I guess I should have added %PATH% \\SOURCEDRIVE\SHAREDDOCS?

btw, here is the full command in my batch file:

XCOPY \\SOURCEDRIVE\SHAREDDOCS\MAILROOM /EXCLUDE:dontcopy.txt C:\RECEIVE

My goal is to take all of the files (save the five listed in
"dontcopy.txt"!) and copy them from a subdirectory called "Mailroom" on my
server to a subdirectory called "Receive" on my laptop.

(The file "dontcopy.txt" is in \\SOURCEDRIVE\SHAREDDOCS\MAILROOM)


Thanks,



"Bob I" <birelan@xxxxxxxxx> wrote in message
news:OFKA7WsYFHA.712@xxxxxxxxxxxxxxxxxxxxxxx
> From the help
> " /EXCLUDE:file1[+file2][+file3]...
> Specifies a list of files containing strings. Each string should be in a
> separate line in the files. When any of the strings match any part of the
> absolute path of the file to be copied, that file will be excluded from
> being copied. For example, specifying a string like \obj\ or .obj will
> exclude all files underneath the directory obj or all files with the .obj
> extension respectively."
>
> So
> /EXCLUDE:dontcopy.txt
> NOT
> /EXCLUDE dontcopy.txt
>
> Since where you put the file resulted in "can't read xxx", I suggest
> putting "dontcopy.txt" in a directory that is listed in the PATH listing.
>
> RJB wrote:
>
>> It's all listed in the screens above
>>
>> The donotcopy.txt contains a list - one per line - of each exclded file.
>>
>> The long and short is
>>
>> xcopy \\destinationpath\subdir /EXCLUDE donotcopy.txt
>> \\receivingpath\subdirectory
>>
>>
>>
>>
>>
>> "Pegasus (MVP)" <I.can@xxxxxxx> wrote in message
>> news:OsRQprkYFHA.3188@xxxxxxxxxxxxxxxxxxxxxxx
>>
>>>Let's see your precise command, and the contents of the
>>>exclude file.
>>>
>>>
>>>"RJB" <RJB@xxxxxxxxxxxxxxxxxxxxxxxxx> wrote in message
>>>news:8E2C8AD9-6297-41BA-8154-8EF2CFE8DE01@xxxxxxxxxxxxxxxx
>>>
>>>>I've tried every permutation I can think of, and the results I get are:
>>>> Can't read file: XXX
>>>>
>>>> 0 File(s) copied
>>>>
>>>>(where XXX is whatever file comes after the "/exclude:" switch.
>>>>
>>>>The "donotcopy.txt" file is in the SOURCE directory, correct?
>>>>
>>>>Also, if I just try to exclude file(s) by name - a la /EXCLUDE:ABC*.fil,
>>>>I
>>>>get the same result...
>>>>Can't read file: ABC*.fil
>>>>
>>>>0 File(s) copied
>>>>
>>>>What the heck is going on???
>>>>
>>>>
>>>>
>>>>"Bob I" wrote:
>>>>
>>>>
>>>>>BINGO! We have a Winner! :-) :-)
>>>>>
>>>>>RJB wrote:
>>>>>
>>>>>
>>>>>>At the risk of being redundantly monotonous and obtuse:
>>>>>>
>>>>>>1) Create a notepad file
>>>>>>2) In the file, type:
>>>>>>ABC Jackson.fil
>>>>>>ABC Smith.fil
>>>>>>ABC Alias.fil
>>>>>>ABC Lost.fil
>>>>>>ABC Polar.fil
>>>>>>3) Save it as "filelist.txt"
>>>>>>4) In the xcopy command,
>>>>>> XCOPY \\PATH\SOURCE_SUBDIRECTORY /EXCLUDE filelist.txt
>>>>>>\\PATH\TARGET_SUBDIRECTORY /d /h /p /r /u /k /y
>>>>>>
>>>>>>Close?
>>>>>>
>>>>>>
>>>>>>"Bob I" wrote:
>>>>>>
>>>>>>
>>>>>>
>>>>>>>Inline,
>>>>>>>
>>>>>>>RJB wrote:
>>>>>>>
>>>>>>>
>>>>>>>
>>>>>>>>Yeah, I gotta say, Pegasus, your solution gives me an ice cream
>>>
>>>headache.
>>>
>>>>>>>>I still don't know if I get the "file listing" info...
>>>>>>>
>>>>>>>>>From your initial post, it seems as if I am creating a file - called
>>>
>>>"file1"
>>>
>>>>>>>>- and in that file it includes a list of excluded files.
>>>>>>>
>>>>>>>CORRECT
>>>>>>>
>>>>>>>
>>>>>>>
>>>>>>>>But I probably just want to do
>>>>>>>>/EXCLUDE ABC*.fil
>>>>>>>
>>>>>>>Wrong, should be like this
>>>>>>>
>>>>>>>XCOPY /EXCLUDE FILELIST.TXT
>>>>>>>
>>>>>>>FILELIST.TXT contents are ABC*.fil
>>>>>>>one entry per line, you may have to experiment with it a bit.
>>>>>>>
>>>>>>>
>>>>>>>
>>>>>>>>Which is what your most recent post says. Right?
>>>>>>>
>>>>>>>nope.
>>>>>>>
>>>>>>>
>>>>>>>>Anyway, I think I have enough info to experiment with.
>>>>>>>>
>>>>>>>>Thanks,
>>>>>>>>
>>>>>>>>
>>>>>>>
>>>>>>>
>>>>>
>>>
>>
>>
>


.



Relevant Pages

  • Re: How to copy whole folders?
    ... First of all your syntax is different than xcopy help shows: ... I want just to move my batch file from one folder to another and run it ... error and restart the same xcopy command until all files are copied. ...
    (microsoft.public.windows.file_system)
  • Re: Mass copy of files: how to?
    ... Avoiding "command lines" means that you have to perform the ... suggest a reliable batch file solution based on robocopy.exe. ... (which would be nice when using the Task Scheduler). ... A VERY brief tutorial on how to do this - use a batch file where you redirect the output to log files - for example, even using xcopy right now, you can simply append "output.log 2>&1" and "see" all that you would see if you run the command manually. ...
    (microsoft.public.windows.server.general)
  • Re: Making backups by just copying files
    ... will not restore my OS in case of a disaster (HD faulure, ... one clever batch file will handle that. ... your command at the Command Prompt. ... Xcopy the 3 folders should cover the OS and programs. ...
    (microsoft.public.windowsxp.general)
  • Re: Batch File Problem
    ... >> batch file is using xcopy and the manual copy used copy. ... >There is no difference between running a command from the ... >Command Prompt or running it inside a batch file. ...
    (microsoft.public.windowsxp.general)
  • Re: Using the result of findstr
    ... If this is going into a batch file, use %%q instead of %q where you see it ... > I want to use the findstr command to identify files with certain strings ... > set, but it didnt work. ...
    (microsoft.public.windows.server.scripting)

Loading