![]()
[<<]Message[>>] [<<]Author[>>] [<<]Subject[>>] [<<]Thread[>>]
Number : 2411 Date : 2002-07-05 Author : Garry Deane Subject : Re: A few tips in batch scripts Size(KB) : 1
Kan, Seeing your recent post on the use of /ec & /ce reminded me that it would sometimes be useful to be able to 'initialise' xxcopy's previous errorlevel to 0. I have one particular task in which I use a fairly complex batch which carries out several checks on the passed parameters before carrying out a single xxcopy using those parameters. To make the use of the batch easy, this complex batch is called several times with a simple batch containing a list of parameters. Something along the lines of: :: Parent batch file xxcopy /cb0 \\initialise xxcopy error to 0 call mybackup src1 dest call mybackup src2 dest call mybackup src3 dest :: Mybackup batch file :: Do error checking, parameter checking, rotate logs if necessary, :: write logs, etc. xxcopy /cb ... \\do the xxcopy work using passed parameters :: Check for and log errors :: Return to parent I currently handle this with 'if errorlevel' checks at the start of the batch and by manipulating the errorlevel at the end of the batch depending on the xxcopy error. It would be useful to simply 'set xxcopy_error=0' prior to the first call to the xxcopy batch so that /cb could then be specified. Or is there already a way to set the xxcopy error to 0? Garry --- In xxcopy@y..., Kan Yabumoto wrote: > Here, the construct: > > @echo off > xxcopy /ec ... > xxcopy /ce ... > xxcopy /ce ... > xxcopy /ce ... > ...
This message if part of XXCOPY's message Archive. The archive contains all the messages posted at Yahoo!Groups: XXCOPY.