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

Number : 4779 Date : 2003-06-09 Author : Kan Yabumoto Subject : Re: Deleting unneeded files Size(KB) : 1
Garry Wrote: >> I'm pretty sure that the resident Batch-file king, >> Garry can show a solution using dir, sort and >> a few simple tools to accomplish the same thing. >> I only wonder if his solution is shorter than >> 5 lines :-) > > A challenge Kan? Yes, even in DOS/W9x this is > relatively easy with the right tools. How about with > my favourite W9x parsing utility LMOD. > > cd "C:\PROGRAM FILES\GRISOFT\AVG6\UPDATE\" > echo @echo off > delbin.bat > dir *.BIN /a-d/o-d/b|lmod /L2-* del [] >> delbin.bat > delbin.bat > Score: 5 lines Kan's batch file with xxcopy 4 lines Garry's LMOD method Garry, You won. I knew Garry's first step would be DIR /od/b (or its variation). I was hoping to learn some "pure" batch technique which extracts the last (or first) line of the DIR-output and feed to a del command (which LMOD took care of). I guess due to my "challenge", he chose a tool to do just that in a half-line :-) Since having the XXCOPY in my batch file makes my solution not "pure", his use of LMOD is fair game, I guess. For those of you who never heard of LMOD, http://home.mnet-online.de/horst.muc/div.htm#lmod > Of course I'd personally use a single line xxcopy > command for this with the /DB#30 approach and > just leave a few extra .bin files behind until they 'aged'. I agree. Kan Yabumoto
This message if part of XXCOPY's message Archive. The archive contains all the messages posted at Yahoo!Groups: XXCOPY.