[<<]Message[>>]    [<<]Author[>>]    [<<]Subject[>>]        Thread    

Number : 419 Date : 2001-07-18 Author : Joseph Maddison Subject : Re: another project... Size(KB) : 2
> For example, /FILECNT:1000 will stop the current job after processing (be it copy, list, move, or delete) 1000 files. Every once in a while I wish XXCOPY had this feature. But, again, as always, we have to weigh whether it is used by anyone else. < You and me, Kan, that's 2! > If we had the /FILECNT:1000 feature, it will help Joseph's project here. But, the next problem is that somehow we need a mechanism to "synthesize" the new directory name such as \0001\, \0002\ and so on. < Here's an article on a counting batch file. http://www.zdnet.com/pcmag/issues/1511/pcmg0088.htm . Don't try to read the code if you're not into it. Simply know that the line ECHO Directory is %M%%H%%T%%O% (put ECHO commands here) can be replaced with the XXCOPY command XXCOPY /RC /FILECNT:1000 %M%%H%%T%%O%\ Then, as long as XXCOPY returns status 0, keep looping. So, add the following line to exit on a nonzero return status after the XXCOPY line: if errorlevel 1 GOTO OutOfLoop Now replace the demo exit count with '9999' (I leave it as extra credit to rework the batch file to handle more than 10K files!) and replace the SET M=7 to be 0 or 1 to start. *** One last question... XXCOPY is going to process in "directory" file number order instead of LFN order, right? Is there any way to change this behavior? *** This means that I need to physically sort the directory entries under Win2000, which is problematic. Still, the /FILECNT:x would be 95% of the solution. The original batch file from Neil J. Rubenking / PC Magazine: ---------- snip --------------- @ECHO OFF :: --- Set starting value :: --- M=thousands, H=hundreds, T=tens, O=ones :: --- This example starts at 7000 SET M=7 SET H=0 SET T=0 SET O=0 :Loop :ReturnM ECHO Directory is %M%%H%%T%%O% (put ECHO commands here) :: --- Replace '7600' in next line with ending value IF '%M%%H%%T%%O%'=='7600' GOTO OutOfLoop SET Place=O GOTO Inc :ReturnO IF NOT '%O%'=='0' GOTO Loop SET Place=T GOTO Inc :ReturnT IF NOT '%T%'=='0' GOTO Loop SET Place=H GOTO Inc :ReturnH IF NOT '%H%'=='0' GOTO Loop SET Place=M GOTO Inc :Inc IF '%Place%'=='O' SET Value=%O% IF '%Place%'=='T' SET Value=%T% IF '%Place%'=='H' SET Value=%H% IF '%Place%'=='M' SET Value=%M% IF '%Value%'=='0' SET %Place%=1 IF '%Value%'=='1' SET %Place%=2 IF '%Value%'=='2' SET %Place%=3 IF '%Value%'=='3' SET %Place%=4 IF '%Value%'=='4' SET %Place%=5 IF '%Value%'=='5' SET %Place%=6 IF '%Value%'=='6' SET %Place%=7 IF '%Value%'=='7' SET %Place%=8 IF '%Value%'=='8' SET %Place%=9 IF '%Value%'=='9' SET %Place%=0 GOTO Return%Place% :OutOfLoop FOR %%v IN (O T H M Place Value) DO SET %%v= ---------- snip ---------------
This message if part of XXCOPY's message Archive. The archive contains all the messages posted at Yahoo!Groups: XXCOPY.