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

Number : 4777 Date : 2003-06-09 Author : Garry Deane Subject : Re: Deleting unneeded files Size(KB) : 1
--- In xxcopy@yahoogroups.com, Kan Yabumoto wrote: > At first, I thought we could not do it. But, then, > I came up with the following scheme. > > pick_latest.bat > ----------------------------------------------- > xxcopy \src\*.bin \temp\latest\ /rcy/yy > xxcopy \temp\L*\ \temp\temp2\ /SL > xxcopy \temp\temp2\ \temp\temp3\ /SXR > xxcopy \temp\temp3\ \src\ /SGNo > xxcopy \temp\ /RSY/S/YY > ------------------------------------------------ Neat bit of lateral thinking. > 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 IIRC there's some DOS/W9x utilities that don't even need the intermediate batch file and can execute the DEL command directly which would reduce the above to 2 lines. 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'. Garry
This message if part of XXCOPY's message Archive. The archive contains all the messages posted at Yahoo!Groups: XXCOPY.